TheSqrtMinus1 TheSqrtMinus1 - 11 months ago 22
PHP Question

How do I echo the first 500 lines of a file with php?

It's a pretty big file, it'll end up being around a gigabyte.

I just want to show the first 500 lines. The file is preformatted, as it is a log.


You can do like;

$data = file('data.txt');
    echo $data[$i];