摘要:
通过SimpleXML从网页中抽取出网页标题和描述,页面内容被传递给simplexml_load_string()函数后被解析成一个XML文档并返回一个容易处理的对象。如果系统中安装了libtidy扩展,可使用它来规范代码,否则就消除可能产生的警告信息:$file = tidy_repair_string($file); $html = simplexml_load_string($file);// or: $html = @simplexml_load_string($file);// extact the title if ($html->head->title) { $tit 阅读全文
posted @ 2012-01-30 12:01
lsok
阅读(865)
评论(0)
推荐(0)
浙公网安备 33010602011771号