I am trying to have a page always write to the begining of a file, like append but to the start of it instead of from the end.
this next piece of code appends to the end of the file:
$fh = fopen($LogFile, 'a') or die("can't open file");
$Mensaje = "<b>".$_GET["Nick"]."</b> at ".date('d\/m\/Y H:i')." wrote:\"".$_POST["Mensaje"]."\"<br>";
as you can see I already tried the rewind() but didnt succeed, and also failed when tried the fseek() so Im running out of ideas...
It is a flat file and it is writing to it, just not where I want it...