要我帮设计推荐信息摘要:

增加到帝国CMS自定义函数里PHP CODEfunction get_alexarank($url) { $data = get_url_content("http://xml.alexa.com/data?cli=10&dat=nsa&ver=quirk-searchstatus&url=$url"); if (preg_match(&#39;/<POPUL

增加到帝国CMS自定义函数里


PHP CODE


function get_alexarank($url) {

$data = get_url_content("http://xml.alexa.com/data?cli=10&dat=nsa&ver=quirk-searchstatus&url=$url"); if (preg_match('/<POPULARITY[^>]*URL[^>]*TEXT[^>]*"([0-9]+)"/i', $data, $matches)) { $rank = strip_tags($matches[1]);

} else { $rank = 0;

} return $rank;

}

 


分享海报