note 40552 added to function.file-put-contents
| From: | sailquasar at hotmail dot com | Date: | Sun, 07 Mar 2004 19:48:24 +0000 |
| Subject: | note 40552 added to function.file-put-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66403@lists.php.net to get a copy of this message | ||
A slightly more comprehensive adaptation for pre-PHP5:
<?php
if (!function_exists('file_put_contents')) {
define('FILE_APPEND', 1);
function file_put_contents($filename, $content, $flags = 0) {
if (!($file = fopen($filename, ($flags & FILE_APPEND) ? 'a' : 'w')))
return false;
$n = fwrite($file, $content);
fclose($file);
return $n ? $n : false;
}
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.file-put-contents.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40552
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40552&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40552&report=yes
Search -- http://master.php.net/manage/user-notes.php