note 74164 rejected from function.fwrite by bobby
| From: | bobby@php.net | Date: | Wed, 28 Mar 2007 15:17:27 +0000 |
| Subject: | note 74164 rejected from function.fwrite by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-124884@lists.php.net to get a copy of this message | ||
Note Submitter: lil_chav_c at hotmail dot om
----
Here is what i done I can't get fwrite to write a certain line on a certain line.
<?php
$config = 'config.php';
$offline_var = 1;
if (is_writable($config)) {
if (!$handle = fopen($config, 'a')) {
echo "Cannot open file ($config)";
exit;
}
if (fwrite($handle, $offline_var) === FALSE) {
echo "Cannot write to file ($conig)";
exit;
}
echo "Success, wrote ($offline_var) to file ($config)";
fclose($handle);
} else {
echo "The file $config is not writable";
}
?>