The approach I've used is four steps:
(1) read the current file into a variable (which preserves it)
(2) open the 'old' file for writing "w" (which clears it also)
(3) write the "new stuf" to the file first
(4) lastly write the "old stuff" to the file
Here's a code sample that I just tested...........
$new_line="<A HREF=\"$URL\" target=\"_myclassy\"> $LABEL</A><BR>\n";
$filecontents = join ('', file('./classified.html'));
$fp=fopen("./classified.html","w");
fwrite($fp,$new_line);
fwrite($fp,$filecontents);
fclose($fp);
Hope that helps, but YMMV.
CHeers,
Tom Henry
[EMAIL PROTECTED] (Jan Grafström) wrote in
<[EMAIL PROTECTED]>:
>Hi!
>I have this code:
>$message = ereg_replace("\r\n\r\n", "\n<P>", $message);
>And the new rows are placed under the old ones.
>I want to change so the old messages get placed under is that possible?
>Thanks for help.
>Jan
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]