Given this list.txt file:
9
10
19
Guess what?
max(split("\n",$file_handle)) gives me 9
max(explode(PHP_EOL,$file_handle)) gives me 9
Now, on a string:
$string = "9
10
19";
max(split("\n",$string)) gives me 19
Updated: When reading from a file, I get strings and max() can't seems to find the correct max when comparing string values?! 9 is bigger than 10. The same file content on a string works fine. file_get_contents()/fread() same issue.