note 63896 deleted from function.file-put-contents by bjori
| From: | bjori@php.net | Date: | Mon, 03 Apr 2006 19:14:53 +0000 |
| Subject: | note 63896 deleted from function.file-put-contents by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-107245@lists.php.net to get a copy of this message | ||
Note Submitter: file_put_contents() in php 4
Reason: in docs
----
Here you can find a PHP 4 version of file_put_contents()
<?
if ( !function_exists('file_put_contents') ) {
// pruefen ob die Funktion bereits existiert
function file_put_contents($filename, $data) {
if ( is_array($data) ) {
$data = implode('', $data);
// Sollte $data ein Array sein, wird dieser zu einem String
// zusammengefuegt
}
$handle = fopen ($filename, 'w');
// Datei zum schreiben oeffnen und Inhalt loeschen
$return = fwrite($handle, $data, strlen($data));
// Inhalt in die Datei schreiben
fclose($handle);
// Datei schliessen
return $return;
}
}
?>
This Script is is written by http://www.redio.de/t-304.html
(webmaster128)