note 80707 deleted from function.file-get-contents by danbrown
| From: | danbrown@php.net | Date: | Fri, 06 Jan 2012 20:05:24 +0000 |
| Subject: | note 80707 deleted from function.file-get-contents by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185428@lists.php.net to get a copy of this message | ||
Note Submitter: jose dot nobile at gmail dot com
----
<?PHP
//PHP 4.2.x Compatibility function
if (!function_exists('file_get_contents')) {
function file_get_contents($filename, $incpath = false, $resource_context = null)
{
if (false === $fh = fopen($filename, 'rb', $incpath)) {
trigger_error('file_get_contents() failed to open stream: No such file or
directory', E_USER_WARNING);
return false;
}
clearstatcache();
if ($fsize = @filesize($filename)) {
$data = fread($fh, $fsize);
} else {
$data = '';
while (!feof($fh)) {
$data .= fread($fh, 8192);
}
}
fclose($fh);
return $data;
}
}
?>