Looks like all you need to do is insert a statement that writes an "\n" to the file, although what you have should work. Kind of puzzling now that I look at it. Try adding the "\n" to $header before using it in the fwrite statement.
$header .= "\n"; $write = (fwrite($fp, $header)); fflush($fp); fclose($fp);
Matt
Chris Grigor wrote:
Hi
I am writing to a file different sources.
The one writes the date and the next starts writing data.
The date writes fine.
$header = "0$gpsdate";
echo $out_file;
$fp = fopen($out_file, "a");
$write = (fwrite($fp, "$header\n")); fclose($fp);
Now I get to another batch process that inserts data into the same file but it starts on the same line the first time round, then carrys on to the next line..
So I end with this
2003-09-25 data data data data
anyone help out so I can get it to write like this
2003-09-25 data data data
Thanks
Chris
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php