note 47587 deleted from function.fgets by sean

From: Date: Mon, 22 Nov 2004 15:15:29 +0000
Subject: note 47587 deleted from function.fgets by sean
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-80869@lists.php.net to get a copy of this message
Note Submitter: gnif at spacevs dot com ---- Reading the entire file in using fgetc is slow, here is a faster (and less bulky) alternative: <?PHP $delim = '|' $text = file_get_contents('myfile.txt'); $items = explode($delim, $text); ?> $content is now an array of each entry in the file, just itterate it, eg: <?PHP for ($i=0; $i<count($content); $i++) echo $items[$i]; ?> -- http://www.spacevs.com ---- Reason: useless note

« previous php.notes (#80869) next »