Re: PHP File Reading Problem

by Ilya Dubinsky <ilya788(at)inter.net.il>

 Date:  Wed, 05 Apr 2000 12:54:42 +0200
 To:  "Kevin Haidl" <kevinh(at)actofmind.com>
 Cc:  hwg-languages(at)hwg.org
 In-Reply-To:  telus
  todo: View Thread, Original

>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?
         The file you are reading -  is it in DOS text mode or Unix text mode?
				Yours, Ilya.

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