Hi everyone 🙂
i have an application that writes user input to a text file.
as the number of lines in the file increase, the app. slows down.
i need to find a method that reads the number of lines in the text file,
and auto-removes any line past line 50.
is this possible ? thanks for any insights here 🙂
the php i am currently using is -
<?php
$text = $_POST[sendText];
$myfile = fopen("test.txt","a");
$fp = fwrite($myfile,$text);
$fp = fwrite($myfile,chr(13));
fclose($myfile);
print "&response=".$text;
?>