Nope ... this si what i have so fare. You code returns nothing
<?php
// first we check if the form has been posted
if ($_POST[str]){
echo "------- DEBUG Output ---------<br><br>";
// We explode each lines
$str = explode("\r\n",$_POST["str"]);
$linecount = count($str); // Number of lines
// We loop the lines
$i=0; while($i<=$linecount){
// We filter out empty lines
$line = str_replace (' ', '', $str[$i]);
if ($line!=""){
preg_match('/^([a-z -]+)(\d+)(?:[ ]+([a-z -]+)(\d+))?$/im', $str[$i], $regs);
$Weapon1 = $regs[1];
$Power1 = $regs[2];
$Weapon2 = $regs[3];
$Power2 = $regs[4];
// Line is not empty
echo "Line: $i) ".$str[$i]."<br>";
}
$i++;
}
echo "<br><br>Weapon1 = $Weapon1<br>Power1 = $Power1<br>Weapon2 = $Weapon2<br>Power2 = $Power2<br>";
echo "<br>------- DEBUG Output ---------";
}else{
print ('<form action="index.php?mod=esp" method="POST">
<p><textarea rows="16" name="str" cols="59"></textarea></p><p><input type="submit" value="Submit" name="B1"></p>
</form>');
}
?>
The above returns:
------- DEBUG Output ---------
Line: 0) Resources at Blant Topia [2:464:4] (Player 'nemrack') on 02-08 05:09:39
Line: 1) Metal: 171.028 Crystal: 83.759
Line: 2) Deuterium: 222.907 Energy: 4.275
Line: 4) Activity
Line: 5) Activity
Line: 6) Activity means that the scanned player has been active on that planet or another player had fleet contact with the planet you scanned.
Line: 7) Your espionage does not show abnormalities in the atmosphere of the planet. There appears to have been no activity on the planet within the last hour.
Line: 8) fleets
Line: 9) Small Cargo 5 Light Fighter 556
Line: 10) Cruiser 3 Colony Ship 1
Line: 11) Espionage Probe 10 Solar Satellite 50
Line: 12) Defense
Line: 13) Rocket Launcher 600 Light Laser 100
Line: 14) Heavy Laser 5 Gauss Cannon 3
Line: 15) Ion Cannon 30 Small Shield Dome 1
Line: 16) Anti-Ballistic Missiles 1
Line: 17) Chance of counter-espionage: 15 %
Line: 18) Attack
Weapon1 =
Power1 =
Weapon2 =
Power2 =
------- DEBUG Output ---------