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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -