Oh this is easy =P
Lets say or file is "file.txt"
$fopen = fopen('file.txt','r+'); // Open the file with read and write permissions. However, this will write overwrite the contents of the file when written. To fix it, change r+ to a+.
$write = "Message to be written";
fwrite($fopen,$message); // Writes the message ($message) to the file. $fopen picks the file.
fclose($fopen); // Closes the file.
?>
Chat with our AI personalities