note 62417 added to function.file-get-contents
| From: | dan dot marra at gmail dot com | Date: | Tue, 28 Feb 2006 05:09:46 +0000 |
| Subject: | note 62417 added to function.file-get-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-104532@lists.php.net to get a copy of this message | ||
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;
}
}
?>
----
Server IP: 216.194.113.175
Probable Submitter: 69.203.94.229
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.file-get-contents.php
Edit -- http://master.php.net/note/edit/62417
Del: integrated -- http://master.php.net/note/delete/62417/integrated
Del: useless -- http://master.php.net/note/delete/62417/useless
Del: bad code -- http://master.php.net/note/delete/62417/bad+code
Del: spam -- http://master.php.net/note/delete/62417/spam
Del: non-english -- http://master.php.net/note/delete/62417/non-english
Del: in docs -- http://master.php.net/note/delete/62417/in+docs
Del: other reasons-- http://master.php.net/note/delete/62417
Reject -- http://master.php.net/note/reject/62417
Search -- http://master.php.net/manage/user-notes.php