kāds nevar mazliet palīdzēt?
function log_to_file ($data)
{
$filename = "log.txt";
$data .= "\n";
// open the log file
if ($fp = fopen($filename, "ab"))
{
// now write to the file
if ((fwrite($fp, $data) === FALSE))
{
echo "Could not write to file.<br />";
}
}
else
{
echo "File could not be opened.<br />";
}
}
vajadzētu lai pirms rakstīšanas pārbauda faila izmēru un ja ir virs (nu piemēram) 10Mb, tad lai dzēš saturu (ne pašu failu) un raksta no jauna..?
iepriekš paldies!