PHP code example of tburry / pquery

1. Go to this page and download the library: Download tburry/pquery 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/ */

    

tburry / pquery example snippets


$html = '<div class="container">
  <div class="inner verb">Hello</div>
  <div class="inner adj">Cruel</div>
  <div class="inner obj">World</div>
</div>';

$dom = pQuery::parseStr($html);

$dom->query('.inner')
    ->tagName('span');

$dom->query('.adj')
    ->html('Beautiful')
    ->tagName('i');

echo $dom->html();