need help with fwrite() - a new line every entry...
Posted: Sat Jun 17, 2006 11:29 am
hi, i need some help with fwrite(), lets say i have this code:
every time i write this:
i add a new entry but the problem is that every entry is added at the same line...
so if i do this:
the file looks like this:
and i want it to be:
what do i need to add fwrite("... here"); to make every entry in its own line...
Code: Select all
function log ($text)
{
$file = fopen('log.txt', 'a', 1);
fwrite($file, $text);
fclose($file);
}Code: Select all
log("this is a log entry");so if i do this:
Code: Select all
log("this is a log entry ");
log("this is the second log entry ");
log("this is the third log entry");Code: Select all
this is a log entry this is the second log entry this is the third log entryCode: Select all
this is a log entry
this is the second log entry
this is the third log entry