PHP code example of ahfeel / php-query

1. Go to this page and download the library: Download ahfeel/php-query library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ahfeel / php-query example snippets



 $doc = phpQuery::newDocumentHTML($markup); 
 $doc = phpQuery::newDocumentXML();
 $doc = phpQuery::newDocumentFileXHTML('test.html'); 
 $doc = phpQuery::newDocumentFilePHP('test.php'); 
 $doc = phpQuery::newDocument('test.xml', 'application/rss+xml'); 
 $doc = phpQuery::newDocument('<div/>');
//Manipulating
$doc['ul > li'] ->addClass('my-new-class') 
//For more information about usage, visit the code.google.com/p/phpquery pahe



composer