note 39817 deleted from function.file-get-contents by pollita
| From: | pollita@php.net | Date: | Mon, 16 Feb 2004 00:38:43 +0000 |
| Subject: | note 39817 deleted from function.file-get-contents by pollita | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-65189@lists.php.net to get a copy of this message | ||
Note Submitter:
----
To be exactly compatible with file_get_contents, that should be:
<?php
if (!function_exists("file_get_contents")) {
function file_get_contents($filename, $use_include_path = 0) {
$data = FALSE;
$file = fopen($filename, "rb", $use_include_path);
if ($file) {
while (!feof($file)) $data .= fread($file, 1024);
fclose($file);
}
return $data;
}
}
?>
That is, return FALSE on failure, and print error messages from fopen().