PHP: clear a text file if it exceeds 50 lines -
ok, missing? trying clear file if exceeds 50 lines.
this have far.
$file = 'idata.txt'; $lines = count file($file); if ($lines > 50){ $fh = fopen( 'idata.txt', 'w' ); fclose($fh); }
$file = 'idata.txt'; $lines = count(file($file)); if ($lines > 50){ $fh = fopen( 'idata.txt', 'w' ); fclose($fh); }
Comments
Post a Comment