note 42773 added to function.file-get-contents
| From: | (http://www.sethkinast.com) | Date: | Fri, 28 May 2004 15:23:05 +0000 |
| Subject: | note 42773 added to function.file-get-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70248@lists.php.net to get a copy of this message | ||
The guy from ragnarokonline has a good implementation for PHP < 4.3.0 except for one thing: if
you call that homebrew function multiple times in one script, and you've changed the filesize
in between calls (by writing to the file), horrible errors occur as the function uses the cached
filesize() rather than getting the new filesize as get_file_contents() does. So it's best to
add a clearstatcache(); to his function as the first line.
Seth
----
Manual Page -- http://www.php.net/manual/en/function.file-get-contents.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42773
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42773&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42773&report=yes
Search -- http://master.php.net/manage/user-notes.php