Heres the code:
<?php
$filename = "myfile.txt";
//first, obtain the data initially present in the text file
$ini_handle = fopen($filename, "r");
$ini_contents = fread($ini_handle, filesize($filename));
fclose($ini_handle);
//done obtaining initially present data
//write new data to the file, along with the old data
$handle = fopen($filename, "w+");
$writestring = "text to write to file\n" . $ini_contents;
if (fwrite($handle, $writestring) === false) {
echo "Cannot write to text file. <br />";
}
fclose($handle);
?>
How exactly do I link that with the results? Sorry im new to php. Thank you.