simple_html_dom插件
用dom处理html文件的利器
使用:
加载simple_html_dom.php文件
require_once 'simple_html_dom.php'
new simple_html_dom对象
$dom = new simple_html_dom()
加载html
$dom->load($html);
find()方法
$dom->find('div.lookLeftname', 0)->plaintext
class=‘lookLeftname'的div中的纯文本
$dom->find('div.lookLeftname', 0)->innertext
class='lookLeftname'的div中的内部文本
plaintext 与innertext最常用的
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn