With a quick google search:
http://www.w3schools.com/php/php_file.asp
Reading a File Line by Line
The fgets() function is used to read a single line from a file.
Note: After a call to this function the file pointer has moved to the next line.
Example from W3 Schools:
The example below
reads a file line by line, until the end of file is reached:
<?php
$file = fopen("welcome.txt", "r") or exit("Unable to open file!");
//Output a line of the file until the end is reached
while(!feof($file))
{
echo fgets($file). "<br />";
}
fclose($file);
?>
All you need to do is have your counting variable that counts up to 10 within that while loop. once it hits 10, do what you need to do.