php - Why does fgets read the same lines over and over in wrong order? -
i have been using fgets
read list of (20,000) words in file. working fine yesterday, somehow reads text file, list - out of order, reads of same sections on multiple times. it's 1 word per line. simple problem, enough stop workflow in tracks.
$fh = fopen('newsymbols.txt','r') or die($php_errormsg); while (! feof($fh)) { if ($s = fgets($fh,1024)) {
curious if encountered strangeness fgets
. using instead of file_get_contents
because particular script used dom objects
eat memory in foreach
loops.
well not iterating through lines because while condition have setted fgets
$fh = fopen('newsymbols.txt','r') or die($php_errormsg); while ($s = fgets($fh,1024)) { if ( feof($fh)) {
Comments
Post a Comment