to put icaro´s words in code:
$fp=fopen($filename, "r"); // $filename needs to be specified somewhere above.
$tmp=fread($fp,filesize($filename));
fclose($fp);
$string_to_write = $yourstring . $tmp;
$fp= fopen($filename, "w");
fwrite($fp,$string_to_write);
fclose($fp);
Hope I didn´t get anything wrong here..
😉
FAB
PS: If you want to have a new line, do not forget to add a \n to your $yourstring.