Simple_html_dom Plug-in
A powerful tool for processing HTML files with the DOM
use:
Load the simple_html_dom.php file
Copy CodeThe code is as follows:
Require_once ' simple_html_dom.php '
New Simple_html_dom Object
Copy CodeThe code is as follows:
$dom = new Simple_html_dom ()
Loading HTML
Copy CodeThe code is as follows:
$dom->load ($html);
Find () method
Copy CodeThe code is as follows:
$dom->find (' Div.lookleftname ', 0)->plaintext
Plain text in class= ' Lookleftname ' div
Copy CodeThe code is as follows:
$dom->find (' Div.lookleftname ', 0)->innertext
class= inner text in the div ' lookleftname '
plaintext and innertext are the most commonly used
http://www.bkjia.com/PHPjc/327965.html www.bkjia.com true http://www.bkjia.com/PHPjc/327965.html techarticle Simple_html_dom plugin uses DOM to handle HTML files: Load simple_html_dom.php file copy code code as follows: require_once ' simple_html_dom.php ' new Simple_html_dom Object ...