TheSqrtMinus1 TheSqrtMinus1 - 2 years ago 64
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.

Answer Source

You can do like;

$data = file('data.txt');
    echo $data[$i];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download