note 38055 deleted from function.file-put-contents by sniper
| From: | sniper@php.net | Date: | Sat, 03 Jan 2004 02:48:14 +0000 |
| Subject: | note 38055 deleted from function.file-put-contents by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62841@lists.php.net to get a copy of this message | ||
Note Submitter: Andre
----
I think this is very the same:
<?php
if (!function_exists('file_put_contents')) {
if (!defined('FILE_APPEND')) {
define('FILE_APPEND', 8);
}
if (!defined('FILE_USE_INCLUDE_PATH')) {
define('FILE_USE_INCLUDE_PATH', 1);
}
function file_put_contents($filename, $data, $flags = 0) {
$mode = $flags & FILE_APPEND ? 'ab' : 'wb';
$fh = fopen($filename, $mode, $flags & FILE_USE_INCLUDE_PATH);
$bytes_written = fwrite($fh, $data);
fclose($fh);
return $bytes_written;
}
}
?>