Re: PHP File Reading Problem

by "Rossi Designs" <webmaster(at)rossidesigns.net>

 Date:  Wed, 5 Apr 2000 09:10:31 -0400
 To:  "Kevin Haidl" <kevinh(at)actofmind.com>,
<hwg-languages(at)mail.hwg.org>
 References:  telus
  todo: View Thread, Original
Why are you reading such a low number of characters?

Rossi Designs
PO Box 1084
Holly Hill, FL 32125-1084
Phone : (904) 226-8979
URL : http://rossidesigns.net
----- Original Message -----
From: Kevin Haidl <kevinh(at)actofmind.com>
To: <hwg-languages(at)mail.hwg.org>
Sent: Wednesday, April 05, 2000 4:32 AM
Subject: PHP File Reading Problem


| My fgets() seems to be broken (or I've completely misunderstood the
| documentation.)
|
| $datafile = fopen($sourcePath, "r");
| while(!feof($datafile)) {
|     $line = fgets($datafile, 32);
|     echo("$line<br>");
| }
|
| Specifically, the fgets() in the above code do not stop reading the file
| when it encounters a newline.  The function always reads 31 characters.
| This is distinctly inconvenient.  Anybody seen this before?  Any
suggestions
| for a workaround?
|
| Linux
| PHP 3.0.12
|
| Kevin Haidl
|
|

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA