you could use file()
$line = file(./yourfile.txt);
will fill the array $line[] with the lines from yourfile.txt
so you could write line five by using
echo $line[5];
dont forget... this also imports the newline command at the end of each line
.. if you want rid of that use
$line[5] = trim($line[5]);
or if u use a loop
$line[$n] = trim($line[$n]);
hope this helps