php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26856 fread problem
Submitted: 2004-01-09 14:06 UTC Modified: 2004-01-09 14:22 UTC
From: robson at tikaboo dot com dot br Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.4 OS: mdk 9.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: robson at tikaboo dot com dot br
New email:
PHP Version: OS:

 

 [2004-01-09 14:06 UTC] robson at tikaboo dot com dot br
Description:
------------
I?m trying to read an archive as follow : 
 
$fp = fopen($arc,"r"); 
while( $ch = fread($fp,1) ) 
 
 
but when read a zero ( 0 ) , it stops ( like a EOF ) 
 
if I change my code, reading two bytes while( $ch = fread($fp,2) ) 
, it works with no problem. 
 
tks 
 
Robson 
Brazil 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-09 14:22 UTC] andrey@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Use strict checking. === of == and checking against false/true. PHP is close to C but not C, we have boolean type.
Look here for an example : http://de3.php.net/manual/en/function.readdir.php
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 10 23:00:01 2025 UTC