note 21978 added to function.file
| From: | e dot maccarthy at csuohio dot edu | Date: | Sun, 02 Jun 2002 19:04:18 +0000 |
| Subject: | note 21978 added to function.file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31349@lists.php.net to get a copy of this message | ||
Here is a quick snippet that will read in N number of lines of a file, then print them.
$n=10
$fp = file(/path/to/your/file);
$i=0
while($i < $n){
echo "$fp[$i]";
$i++;
}
I am using this right now to display the current progress of the seti@home client working on my
server, instead of displaying the whole thing, which isn't web page friendly.
Because sometimes short really is sweet...
--
http://www.php.net/manual/en/function.file.php
http://master.php.net/manage/user-notes.php?action=edit+21978
http://master.php.net/manage/user-notes.php?action=delete+21978
http://master.php.net/manage/user-notes.php?action=reject+21978