PHP code example of felipe1234-dev / php-dom-query
1. Go to this page and download the library: Download felipe1234-dev/php-dom-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/ */
felipe1234-dev / php-dom-query example snippets
w WebParser();
$doc->loadHTMLFile($url);
$doc->Q("img")->wrap("<figure></figure>");
$doc->output();
$doc = new WebParser();
$doc->loadHTMLFile($url);
$doc->Q("ol")->append("<li>Appended item</li>");
$doc->output();
$doc = new WebParser();
$doc->loadHTMLFile($url);
$doc->Q("a:first")->href("folder/index.html");
$doc->output();
composer
git clone git://git.code.sf.net/p/jquery-like-php-dom/repository jquery-like-php-dom