note 62417 deleted from function.file-get-contents by nlopess
| From: | nlopess@php.net | Date: | Sun, 16 Apr 2006 22:34:08 +0000 |
| Subject: | note 62417 deleted from function.file-get-contents by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-108292@lists.php.net to get a copy of this message | ||
Note Submitter: dan dot marra at gmail dot com
----
A friend of mine running php < 4.3 was dissapointed to find this function not supported when
trying to run a script he found, so I wrote him an equivalent to blend in seemlessly. I figured
I'd share it.
<?PHP
if(!function_exists("file_get_contents"))
{
function file_get_contents($filename)
{
if(($contents = file($filename)))
{
$contents = implode('', $contents);
return $contents;
}
else
return false;
}
}
?>