note 42584 added to function.file-get-contents
| From: | mattsoft at mattsoft dot net | Date: | Sat, 22 May 2004 06:09:21 +0000 |
| Subject: | note 42584 added to function.file-get-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69934@lists.php.net to get a copy of this message | ||
if($filedata=file_get_contents($full_path)){
...
}
I use this in a script because it loads large files a lot faster then fopen with a loop, but I found
that if the file it's reading is empty, it returns false. here is what I did to fix the
problem.
if(is_readable($full_path)){
$filedata=file_get_contents($full_path);
...
}
----
Manual Page -- http://www.php.net/manual/en/function.file-get-contents.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42584
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42584&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42584&report=yes
Search -- http://master.php.net/manage/user-notes.php