note 48438 added to function.file-put-contents
| From: | llcooldanny | Date: | Thu, 23 Dec 2004 17:31:26 +0000 |
| Subject: | note 48438 added to function.file-put-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-82213@lists.php.net to get a copy of this message | ||
If you want to use file_put_contents in PHP 4.x, you can use this:
<?php
if(!function_exists('_file_put_contents')) {
function _file_put_contents($filename, $data, $file_append = false) {
$fp = fopen($filename, (!$file_append ? 'w+' : 'a+'));
if(!$fp) {
trigger_error('file_put_contents cannot write in file.', E_USER_ERROR);
return;
}
fputs($fp, $data);
fclose($fp);
}
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.file-put-contents.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48438
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48438&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48438&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48438&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48438&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48438&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48438&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48438&report=yes
Search -- http://master.php.net/manage/user-notes.php