$new_text = "i want this so go in the begining of the textfile its writing to\n";
$your_file = "file.txt";
$txt = file_get_contents($your_file);
$txt = $new_txt . $txt;
$fp = fopen($your_file, 'w');
fwrite($fp, $txt);
fclose($fp);
ok i got it to work without the "$txt = $new_txt . $txt; " but when i take that out it deletes everything in the file so im guessing that was what made it not clear out the whole text file, so is "$txt = $new_txt . $txt; " the right thing? cause nothing happens when i include that in the file