note 101998 deleted from function.fread by danbrown
| From: | danbrown@php.net | Date: | Sat, 22 Jan 2011 03:14:04 +0000 |
| Subject: | note 101998 deleted from function.fread by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-175995@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
if you recently appended something to file, and closed it then this method will not show appended
data:
<?php
// get contents of a file into a string
$filename = "/usr/local/something.txt";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
?>
You should insert a call to clearstatcache() before calling filesize()
I've spent two hours to find that =/