You can read the files into an array:
/***********************
$fp = fopen($file,"r");
flock($fp,1);
$counter=0;
while(! feof($fp))
{
$line[$counter++]=fgets($fp,1024);
}
flock($fp,1);
fclose($fp);
/***********************
Now all the lines from your file are added into an array.
print"$line[2]"; prints http://link3.com
an array starts counting with 0
I hope this helpes you..
Mark