Is there a PHP class like JS manipulating the DOM model in HTML, recommending a solution

Source: Internet
Author: User
Is there a PHP class like JS manipulating the DOM model in HTML, recommending a
Currently found an HTML SQL class, the function is also good, unfortunately the author is in the function of the fancy, complicated.

Want to implement one of these features.

$body = File_get_content (http://www.4wei.cn);

$title = Dom (' title ');

$div = Dom ()->tag (' div ')->id (' my_div_id ');
$class = $div->class;

$input = Dom ()->form (' My_form ')->tag (' input ')->name (' name ');
$input->value;

This function.

------Solution--------------------
Help you top
------Solution--------------------
The system comes with the DOMDocument class
------Solution--------------------
How's It coming?
------Solution--------------------
discuss
Finding an HTML DOM class is almost the effect I want.

PHP Simple HTML DOM Parser

Http://simplehtmldom.sourceforge.net/manual.htm

------Solution--------------------
Phpquery
------Solution--------------------
Thanks for sharing ~
------Solution--------------------
Mark
------Solution--------------------
PHP Simple HTML DOM Parser Good,
Note, however, that it is prone to memory problems, and you should explicitly call its __destruct function after the object has been exhausted.
  • 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.