note 71419 added to function.file
| From: | info at carstanje dot com | Date: | Tue, 28 Nov 2006 08:33:14 +0000 |
| Subject: | note 71419 added to function.file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-120119@lists.php.net to get a copy of this message | ||
Using file() for reading large text files > 10 Mb gives problems, therefore you should use this
instead. It is much slower but it works fine. $lines will return an array with all the lines.
$handle = @fopen('yourfile...', "r");
if ($handle) {
while (!feof($handle)) {
$lines[] = fgets($handle, 4096);
}
fclose($handle);
}
----
Server IP: 83.137.20.120
Probable Submitter: 212.45.32.70
----
Manual Page -- http://www.php.net/manual/en/function.file.php
Edit -- https://master.php.net/note/edit/71419
Del: integrated -- https://master.php.net/note/delete/71419/integrated
Del: useless -- https://master.php.net/note/delete/71419/useless
Del: bad code -- https://master.php.net/note/delete/71419/bad+code
Del: spam -- https://master.php.net/note/delete/71419/spam
Del: non-english -- https://master.php.net/note/delete/71419/non-english
Del: in docs -- https://master.php.net/note/delete/71419/in+docs
Del: other reasons-- https://master.php.net/note/delete/71419
Reject -- https://master.php.net/note/reject/71419
Search -- https://master.php.net/manage/user-notes.php