[SOLVED]fwrite problem
Posted: Thu Aug 31, 2006 6:52 am
I have the following code:
This code is inside a while loop, so should write one line for each pass of the loop. For some reason it stops after one line. I know the loop is executing as the content on the page prints out correctly.
Code: Select all
$filename = 'clan/test.csv';
if (file_exists($filename))
{
unlink($filename);
}
$label = fopen($filename, 'a') or die("Couldn't open file.");
@fwrite($label, $label_string) or die("Couldn't write to file.");
fclose($label);