Note that the above solution would load the entire file into memory, even though this isn't necessary. You could optimize memory usage like so:
<?php
$file = fopen('file.txt', 'r');
for($i = 0; $i < 5; $i++)
echo fgets($file, 8152);
fclose($file);
?>