As much as I hate to give this out, it is by no means unique... I just think every developer should be a man and master the mighty regex.
Here's a raw version, not totally valid, but will get most links with some variation on attribute placement.
function parseLinks($strFile) {
/
parses out all <a hrefs> and creates GLOBALS['LINK_ARRAY']
ARRAY is structured as follows:
$GLOBALS['LINK_ARRAY'][0][$key] contains the full HTML link
$GLOBALS['LINK_ARRAY'][1][$key] contains the actual link URL
$GLOBALS['LINK_ARRAY'][2][$key] contains the linking page text
/
@preg_match_all('/<A+ [?]|HREF=+\'\"(.[>]+)\'\">(.[<]+)<\/A>/i',
$strFile, $GLOBALS['LINK_ARRAY']);
}