Printing just the top 5 lines [PHP]


<?php
$fp = fopen('db.php','r');
if (!$fp) {echo 'ERROR: Unable to open file.'; exit;}

while (!feof($fp)) {
$line = fgets($fp, 1000);
list ($field1, $field2, $field3, $field4, $field5, $field6) = split ('\|', $line);
echo '

<tr>
<td>'.$field1.'</td>
</tr>';
$fp++;
}
 
fclose($fp);
 
?>

How can i makes it so that $line only selects the top 5 lines?