note 39722 added to function.file-put-contents
| From: | greutatalterndotorg at rn2 dot php dot net | Date: | Sun, 08 Feb 2004 21:06:23 +0000 |
| Subject: | note 39722 added to function.file-put-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64844@lists.php.net to get a copy of this message | ||
A little adaptation of file_get_contents() for < PHP 5
<?php
if (!function_exists("file_put_contents")) {
function file_put_contents($filename,$content) {
if(!$file = fopen($filename, "w+"))
{
return false;
}
if($file)
{
if(!fwrite($file,$content))
{
return false;
}
fclose($file);
}
return true;
}
}?>
----
Manual Page -- http://www.php.net/manual/en/function.file-put-contents.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39722
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39722&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39722&report=yes
Search -- http://master.php.net/manage/user-notes.php