Hey I was wondering how do you write new information to a file at the top of the file. I tried using w, w+, and the rest of those functions for fopen but it just replaces the information. Can someone help? Thanks
I'm not really sure bout the functions for fopen. What I did was ... read the current information, store it in a variable, get new information and combine it with the old information, then finally write them to the file.
Hope it helps.
-scoppc-
How exactly would you do that?A man
should do the trick -
<?
$content = implode(' ', file($filename));
$new_file = $new_content . $content;
$fp = fopen($filename,w);
$fp = fwrite($fp,$new_file);
fclose($fp);
?>