Is there any PHP class like JavaScript to manipulate DOM models in HTML? we recommend a solution-php Tutorial

Source: Internet
Author: User
Is there a PHP class like JavaScript that controls DOM models in HTML? I recommend a class that finds HTMLSQL, which has good functions. Unfortunately, I feel that the author is making the function fancy and complicated. To implement such a function. $ Bodyfile_get_content (www.4wei.cn); $ titledom (title); $ divdom ()-& gt; tag (div)-& is there any PHP class like JavaScript to manipulate DOM models in HTML?
At present, I have found an html SQL class with good functions. Unfortunately, I feel that the author is making the function fancy and complicated.

To implement such a function.

$ Body = file_get_content (http://www.4wei.cn );

$ Title = dom ('title ');

$ P = dom ()-> tag ('P')-> id ('My _ p_id ');
$ Class = $ p-> class;

$ Input = dom ()-> form ('My _ form')-> tag ('input')-> name ('name ');
$ Input-> value;

This feature.

------ Solution --------------------
Help you top
------ Solution --------------------
Built-in DOMDocument class
------ Solution --------------------
Look up.
------ Solution --------------------
Discussion
Find an html dom class, which is almost what 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 is good,
However, note that it is prone to memory problems. after an object is used up, it must explicitly call its _ destruct function.

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.