<?php $fp = file_get_contents('http://mail.ru/'); if(preg_match_all('#<a.*>(.*)</a>#',$fp, $matches)) { foreach ($matches[1] as $link) { echo $link.'<br>'; } } ?>