/************************* * Simple file function * **************************/
//Writing Files
//Write Modes // "w" Write Only -- Will overwrite content of file, creates file if one doesnt exist. // "w+" Write & Read -- Will overwrite content of file, creates file if one doesnt exist. // "a" Write To End -- Writes to the end of file, creates file if one doesnt exist // "a+" Read & Write -- to end of file, creates file if one doesnt exist function writefile($filename, $data, $mode) { $fp = fopen($filename, $mode); fwrite($fp, $data); fclose($fp); }
//example //writefile("temp.txt", "poop", "a+"); ?>
|