Sean Burlington wrote:
Thanks it works.Antti wrote:just open it in the right modeHow can I add lines to a text file? I didn't find any function for this. Thanks, antti.
if you just need to add to the end of the file without doing anything else with it first
$fp = fopen ("/home/rasmus/file.txt", "a");
'a' - Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it.
http://www.php.net/manual/en/function.fopen.php
then use fwite to actually write to it
I forgot to say that i need to add a new line to that file. Now it puts all the stuff at the same line. How do I make it to add lines?
Antti
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php