欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

淺析php插件 Simple HTML DOM 用DOM方式處理HTML

 更新時(shí)間:2013年07月01日 11:17:04   作者:  
本篇文章是對php插件Simple HTML DOM 用DOM方式處理HTML進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
simple_html_dom插件
用dom處理html文件的利器
使用:
加載simple_html_dom.php文件
復(fù)制代碼 代碼如下:

require_once 'simple_html_dom.php'

new simple_html_dom對象
復(fù)制代碼 代碼如下:

$dom = new simple_html_dom()

加載html
復(fù)制代碼 代碼如下:

$dom->load($html);

find()方法
復(fù)制代碼 代碼如下:

$dom->find('div.lookLeftname', 0)->plaintext

class=‘lookLeftname'的div中的純文本
復(fù)制代碼 代碼如下:

$dom->find('div.lookLeftname', 0)->innertext

class='lookLeftname'的div中的內(nèi)部文本
plaintext 與innertext最常用的

相關(guān)文章

最新評論