$f = fopen("../log/path.log", "r"); while (fgets($f)) { echo fgets($f);} fclose($f); 

File log.path:

 1480845953|http://mysite.local/index.php|/index.php?id=contact 1480845957|http://mysite.local/index.php?id=contact|/index.php 1480845959|http://mysite.local/index.php|/index.php?id=contact 1480845960|http://mysite.local/index.php?id=contact|/index.php?id=about 1480845961|http://mysite.local/index.php?id=about|/index.php?id=info 1480845963|http://mysite.local/index.php?id=info|/index.php 1480845966|http://mysite.local/index.php|/index.php?id=info 1480845969|http://mysite.local/index.php?id=info|/index.php?id=log 1480846037|http://mysite.local/index.php?id=info|/index.php?id=log 1480846042|http://mysite.local/index.php?id=info|/index.php?id=log 1480846045|http://mysite.local/index.php?id=info|/index.php?id=log 1480846076|http://mysite.local/index.php?id=info|/index.php?id=log 1480846079|http://mysite.local/index.php?id=info|/index.php?id=log 1480846121|http://mysite.local/index.php?id=info|/index.php?id=log 1480849480|http://mysite.local/index.php?id=log|/index.php?id=log 1480849495|http://mysite.local/index.php?id=log|/index.php?id=log 1480849514|http://mysite.local/index.php?id=log|/index.php?id=log 1480849612|http://mysite.local/index.php?id=log|/index.php?id=log 1480849622|http://mysite.local/index.php?id=log|/index.php?id=log 1480849640|http://mysite.local/index.php?id=log|/index.php?id=log 1480849909|http://mysite.local/index.php?id=log|/index.php?id=log 1480851576|http://mysite.local/index.php?id=log|/index.php?id=log 1480851584|http://mysite.local/index.php?id=log|/index.php?id=log 

Result:

 1480845957|http://mysite.local/index.php?id=contact|/index.php 1480845960|http://mysite.local/index.php?id=contact|/index.php?id=about 1480845963|http://mysite.local/index.php?id=info|/index.php 1480845969|http://mysite.local/index.php?id=info|/index.php?id=log 1480846042|http://mysite.local/index.php?id=info|/index.php?id=log 1480846076|http://mysite.local/index.php?id=info|/index.php?id=log 1480846121|http://mysite.local/index.php?id=info|/index.php?id=log 1480849495|http://mysite.local/index.php?id=log|/index.php?id=log 1480849612|http://mysite.local/index.php?id=log|/index.php?id=log 1480849640|http://mysite.local/index.php?id=log|/index.php?id=log 1480851576|http://mysite.local/index.php?id=log|/index.php?id=log 

    1 answer 1

    There was no question, so I had to wipe the dust off the crystal ball.

    This code prints the lines through one, since one line is first read, checked in the while condition, and the other is then read and displayed with the echo command.

    One of the options for properly working code:

     $f = fopen("../log/path.log", "r"); while ($l = fgets($f)) { echo $l; }