PHP expert |
|
Gebruik gewoon file_put_contents()
of met oudere php-versies: fopen(), fwrite(), en fclose().
of van php.net:
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);
}
}
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; } } }
|