Это для одного URL-адреса:
$url = "http://www.stackoverflow.com/";
$check_result = get_detected_and_title( $url );
function get_detected_and_title( $url )
{
$detected = '<detected:url="'.$url.'"/>';
$title = '';
$tmp_html = file_get_contents( $url );
preg_match('/<title>(.*)<\/title>/', $tmp_html, $res);
$title = '<title:'.$url.'="'.$res[1].'"/>';
return array( $detected, $title );
}
На самом деле, после просмотра страниц SO, я думаю, что это ближе к тому, что вы ищете. Хотя требуется некоторая корректировка: Как имитировать поведение Auto-Link StackOverflow