Jump to content

[SOLVED] string a != b ?


Minase

Recommended Posts

i run into this weird problem

here is my code

$input = file_get_contents("test.txt");

preg_match('/Battle Report (.*)Report details/s', $input, $overal);
$overall = $overal[1];

preg_match('/Vitality\n(\S{1,25}) (.*) (.*)/', $overall, $attacker->Dmg);
print_r($attacker->Dmg);

 

and the test.txt

Battle Report 
Name 	Hit points 	Vitality
io 	402 	12.724
tu 	29 	0
Winner: io

io captured: 46 Gold
Report details

 

if i put the above text into a string it works :| but if i read it from a file or via POST it wont :(

any ideas? thank you

Link to comment
https://forums.phpfreaks.com/topic/151115-solved-string-a-b/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.