ID: 25631 User updated by: marqs10 at hotmail dot com Reported By: marqs10 at hotmail dot com Status: Open -Bug Type: *PDF functions +Bug Type: *Directory/Filesystem functions Operating System: XP PHP Version: 4.3.3 New Comment:
changed category Previous Comments: ------------------------------------------------------------------------ [2003-09-23 03:14:51] marqs10 at hotmail dot com Description: ------------ 0 in a text file does not have a length- it returns as an empty string; however,the echo line below does echo a 0 to the screen. There is no way to differentiate between a blank string and a string containing "0". I have not tried this on unix system yet, but definately does not work on windows. Reproduce code: --------------- while(!feof($handle)) { $buffer= fgets($handle); echo "$buffer"; if(strlen($buffer!=0)) { $x=(int)($buffer); $n=(int)($buffer); Expected result: ---------------- it is a simple program that returns the word "ZERO" if a 0 is in the buffer and returns a blank line if the buffer is empty. Actual result: -------------- a blank line is returned regardless if it is a 0 or a blank line. example data file- 655221583 127334 605 0 0 100000 100045 100015015 101015120 012100120 -5000 -2147483648 13 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25631&edit=1