[Solved] if statement always false even if the value comparing must produce true result


file() by default will keep the line break/feed characters. So instead of I, i.e. chr(73), you have three characters probably chr(73)chr(13)chr(10) or chr(73)chr(10)chr(13).
But there is a flag which you can pass as second parameter to have these characters removed (and also ignore otherwise empty lines as well).

$test = file('test.txt',  FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES );

2

solved if statement always false even if the value comparing must produce true result