hi there.
i didn't quit understood what you aimed at, and am in kinda hurry ( my pizza is cooling down :D).
if i got it well, you have one file named e.g. "site.html" and you want to take text links from that file and have it displayed on your other web page.
i've just made some small code, it might need some tweaks because it can be possibly buggy.
so let me explain what it does.
it opens your file named 'site.html'.
then it takes line by line and check it... if line contains parts of string (all 3 required in what i made) "a href" && ".txt" && "</a>", it displays the line.
Code:
<?php
echo "links ending with .txt extension:<br>";
$file = fopen('site.html',"r");
$str = array("a href", ".txt", "</a>");
while(!feof($file))
{
$line = fgets($file);
$i=0;
do{
$check = strpos($line,$str[$i]);
if($i==2 && $check)
{
echo $line;
}
$i++;
}while($check && $i<3);
}
fclose($file);
?>
this might have some problems if your anchor passes into the next line. or you-name-what situation that can occur (e.g. link that contains .txt as part of it, but isnt text file etc).
but i guess it should work well for what you asked

)))
gl i hope it helped d(^_^)b