Phpquery Collection Demo

Source: Internet
Author: User

With the Phpquery class, wrote a collection of demo, a network loan platform for a list for example, we want to collect the platform below the platform name, the structure of the tree as follows

1 include' Phpquery.php ';2 3Phpquery::newdocumentfile (' http://www.wangdaizhijia.com/dangan/');//Get DOM Document4 5 $artlist= PQ (". Terracelist")->find ('. Item. Namebox. Name ');//Filter Nodes6 7 //echo Count ($arrlist)//Quantity8 9 foreach($artlist  as $k=$v){Ten    EchoPq$artlist)->find ("A:eq ($k) ")->text ()." <br/> ";//text method only, HTML method with HTML code One}

The results of the acquisition are as follows:

Phpquery Collection Demo

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.