You would need to use the preg_match_all() function. But remember that file() splits the file into an array of lines, and maybe you have <a> on one line and </a> on the next.
So perhaps best to first use implode() or join() to make a string variable (implode around "\n" for example, and then use the s modifier with preg_match as I will show you).
So if your string variable is $page,
preg_match_all("|(<a[>]+>)(.*)(</a>)|sU", $page, $matches);
echo "<pre>";
print_r($matches);
echo "</pre>";
edit: the regexp is mangled by the forum code. There should be no spaces between the "". To get it, click on quote and cut and paste.