Urbley Posted March 7, 2008 Share Posted March 7, 2008 Ok here's my mission. I play a browser based space battle game and after a battle in this game an attack report is created. It looks like this below.. At 12-12 02:40:00 the following fleets met in battle:: Attacker Chopper (6:234:9) Weapons: 130% Shields: 120% Armour: 120% Type L.Cargo Battleship Bomber Dest. Battlecr. Total 100 500 25 75 235 Weapons 12 2.300 2.300 4.600 1.610 Shields 55 440 1.100 1.100 880 Armour 2.640 13.200 16.500 24.200 15.400 Defender peety (6:240:4) Weapons: 110% Shields: 110% Armour: 110% Type R.Launcher L.Laser H.Laser Total 1.069 508 56 Weapons 168 210 525 Shields 42 53 210 Armour 420 420 1.680 The attacking fleet fires 1.490 times with a total firepower of 3.247.315 at the defender. The defending shields absorb 47.567 damage In total, the defending fleet fires 1.633 times with a total firepower of 315.672 at the attacker. The attackers shields absorb 249.359 damage Attacker Chopper (6:234:9) Type L.Cargo Battleship Bomber Dest. Battlecr. Total 91 500 25 75 235 Weapons 12 2.300 2.300 4.600 1.610 Shields 55 440 1.100 1.100 880 Armour 2.640 13.200 16.500 24.200 15.400 Defender peety (6:240:4) destroyed The attacker has won the battle! He captured 45.347 metal, 19.392 crystal, and 2.265.867 deuterium The attacker lost a total of 108.000 units. The defender lost a total of 3.602.000 units. At these space coordinates now float 16.200 metal and 16.200 crystal. What I really want to do is make a web based converter which will strip this code to pieces and rearrange it to make it more visually appealing when posted on a forum using bbCode... I would like it to look something like this... and applu the bbcode color and center tags. Attacker Chopper Ship1 1000 Ship2 1000 Ship3 1000 Defender Peety Ship1 1000 Ship2 1000 Ship3 1000 The attacker has won the battle! He captured 45.347 metal, 19.392 crystal, and 2.265.867 deuterium The attacker lost a total of 108.000 units. The defender lost a total of 3.602.000 units. At these space coordinates now float 16.200 metal and 16.200 crystal. I have never used php to format strings before so any help you could give me regarding this kind of job would be really helpful. Quote Link to comment Share on other sites More sharing options...
Urbley Posted March 9, 2008 Author Share Posted March 9, 2008 bump! Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 9, 2008 Share Posted March 9, 2008 This has nothing to do with PHP. Formatting of output is the job of CSS or plain HTML. Ken Quote Link to comment Share on other sites More sharing options...
Urbley Posted March 9, 2008 Author Share Posted March 9, 2008 in fairness yeah I probably should have worded this better.... But can I not use php to manipulate the input report at the start of the post to make it look more like the report below? Basically editing the string using PHP and outputting something more usable on a bbCode enabled forum. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.