I am having trouble updating the script. It works for several hours, so I would like it to output live to a text file.
I am running a document using
ob_start();
Then in a while loop (since it iterates through the database records), I have this
$size=ob_get_length();
if ($size > 0)
{
$content = ob_get_contents();
logit($contents);
ob_clean();
}
And finally, the logit function
function logit($data)
{
file_put_contents('log.txt', $data, FILE_APPEND);
}
However, the log file remains empty. What am I doing wrong?
Pablo source
share