An analysis of PHP plugin simple HTML dom processing html_php Tutorial with Dom method

Source: Internet
Author: User
Tags file copy
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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.