[Solved] Issue with returning the last 10 lines of a file in PHP


If the problem is missing line breaks (not clear from the question) wrap everything in <pre>.

echo '<pre>';
echo `tail /home/food.txt`;
echo '</pre>';

Edited to add: <pre> will give you a monospace font by default; you can fix that easily with CSS if it’s a problem.

solved Issue with returning the last 10 lines of a file in PHP