时间:2021-07-01 10:21:17 帮助过:6人阅读
代码如下 | |
function getBaiduHotKeyWord() $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; } |
http://www.bkjia.com/PHPjc/631639.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631639.htmlTechArticle这是一段很简单的程序利用了php的file_get_contents函数来采集百度的数据,然后通过simplexml_load_String把它数据解析出来,这样数据就保存到了一...