/**
* 获取百度的热词
* @user 小杰
* @from http://www.isharey.com/?p=354
* @return array 返回百度的热词数据(数组返回)
*/
/** * 获取百度的热词 * @user 小杰 * @from http://www.isharey.com/?p=354 * @return array 返回百度的热词数据(数组返回) */function getbaiduhotkeyword(){ $templaterss = file_get_contents('http://top.baidu.com/rss_xml.php?p=top10'); if (preg_match('/(.*)/is', $templaterss, $_description)) { $templaterss = $_description [0]; $templaterss = str_replace(&, &, $templaterss); } $templaterss = . $templaterss; $xml = simplexml_load_string($templaterss); foreach ($xml->tbody->tr as $temp) { if (!empty ($temp->td->a)) { $keyarray [] = trim(($temp->td->a)); } } return $keyarray;}
