|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2003-09-23 03:24 UTC] sniper@php.net
  [2003-09-29 05:56 UTC] sniper@php.net
 | |||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 15:00:01 2025 UTC | 
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