note 91705 added to function.file
| From: | DanDavidson at osu1 dot php dot net | Date: | Tue, 23 Jun 2009 21:27:44 +0000 |
| Subject: | note 91705 added to function.file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157288@lists.php.net to get a copy of this message | ||
I might not understand the function correctly, but given the different types of textfiles, sometimes
it ouputs the whole file as a string (php rpm version 5.1.6-20). I always use file_get_contents,
then split on the newline characters like below:
$arrayoflines=preg_split("/\r\n|\n|\r/",file_get_contents($filepath));
That seems to work better for me.
----
Server IP: 209.41.74.194
Probable Submitter: 128.174.124.103
----
Manual Page -- http://www.php.net/manual/en/function.file.php
Edit -- https://master.php.net/note/edit/91705
Del: integrated -- https://master.php.net/note/delete/91705/integrated
Del: useless -- https://master.php.net/note/delete/91705/useless
Del: bad code -- https://master.php.net/note/delete/91705/bad+code
Del: spam -- https://master.php.net/note/delete/91705/spam
Del: non-english -- https://master.php.net/note/delete/91705/non-english
Del: in docs -- https://master.php.net/note/delete/91705/in+docs
Del: other reasons-- https://master.php.net/note/delete/91705
Reject -- https://master.php.net/note/reject/91705
Search -- https://master.php.net/manage/user-notes.php