RE: [PHP] Reading Text file by line
| From: | M.A.Bond | Date: | Mon, 24 Feb 2003 16:37:23 +0000 |
| Subject: | RE: [PHP] Reading Text file by line | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-136939@lists.php.net to get a copy of this message | ||
Using
$var=file('filename.txt');
Creates an array, with each element in the array being 1 line of the file.
Thanks
Mark
-----Original Message-----
From: Anthony [mailto:atampone@attechcomputer.com]
Sent: 24 February 2003 16:24
To: php-general@lists.php.net
Subject: [PHP] Reading Text file by line
I need to read a text file by line, if I open the file and use fgets() then
it doesn't pick up the EOL corretly. So I was planning on reading the whole
file in with fread() and then breaking it up by EOL characters. My question
is, how do I do it? What character do I search for in the string? Anyone
have a simple example on how to do this? Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php