note 43585 added to function.fgets
| From: | keanu77 at tiscali dot it | Date: | Sat, 26 Jun 2004 16:14:32 +0000 |
| Subject: | note 43585 added to function.fgets | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-71787@lists.php.net to get a copy of this message | ||
in my opinion the best way to read an entire file is using the function called file, that will
return an array in which every element will be a line of the file. Then, using the function implode,
it will be possible obtaining only one string that contains the entire file.
Es. : $string=implode('',file("file_name.dat"));
// $string contains the entire file.
----
Manual Page -- http://www.php.net/manual/en/function.fgets.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43585
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43585&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43585&report=yes
Search -- http://master.php.net/manage/user-notes.php