Gracias! yo de momento he probado
Código PHP:
<?php
function get_links($url){
$value = file_get_contents($url);
preg_match_all('/<a [^>]*href=("[^"]*"|\'[^\']*\')[^>]*>/i', $value, $match);
$urls =array_map(create_function('$a','return substr($a, 1, -1);'),$match[1]);
$total=count($urls);
//Comprobar que no estén repetidos
echo 'inicio<br>';
for($i=0;$i<$total;$i++){
echo $urls[$i].'<br>';
}
echo 'fin<br>';
}
$url = "http://www.elrellano.es";
get_links($url);
?>
I solo me imprime 'inicio' y 'fin'..... :(