Based on bytes, not strings, but you can quickly get the total file size with filesize
:
$bytesTotal = filesize("input.txt")
Then, after you have opened the file, you can read each line and then get the current position in the file, something like:
progressBar(0, $bytesTotal);
while (($line = fgets($handle)) !== false) {
doSomethingWith($line, 'presumably');
progressBar(ftell($handle), $bytesTotal);
}
, PHP 2G, , 500 , .