if ($link == true) {
// Links
$link_search = '/\[a\](.*?)\[\/a\]/i';
if (preg_match_all($link_search, $text, $matches)) {
foreach ($matches[1] as $match) {
$match_decode = urldecode($match);
$match_url = $match_decode;
if (!preg_match("/http\:\/\//", $match_decode)) {
$match_url = 'http://' . $match_url;
}
$text = str_replace('[a]' . $match . '[/a]', '<a href="' . strip_tags($match_url) . '" target="_blank" rel="nofollow">' . $match_decode . '</a>', $text);
}
}
}
上面的代码显示了发布的链接和点击重定向到链接的时间。我想要显示的目标链接。例如。计算器显示在后,并点击时需要用户http://stackoverflow.com如何获取URL的标题?
这将需要检索页面并解析出其'
那么,我该如何做呢?请帮助我... – ranger19 2014-10-05 13:38:48