function getBaiduHotKeyWord() { $templateRss = file_get_contents('http://top.baidu.com/rss_xml.php?p=shijian'); If (preg_match('/<table>(.*)<\/table>/is', $templateRss, $_description)) { $templateRss = $_description[0]; $templateRss = str_replace("&", "&", $templateRss); } $templateRss = "<?xml version=\"1.0\" encoding=\"GBK\"?>".trim($templateRss); $xml = simplexml_load_String($templateRss); foreach ($xml->tbody->tr as $temp) { if (!empty ($temp->td->a)) { $keyArray [] = trim(($temp->td->a)); } } return $keyArray; }
详细解决方案
php 取得百度最新事件
热度:142 发布时间:2012-09-04 14:19:30.0
相关解决方案