PHP code example of coreconst / php-dom-plus
1. Go to this page and download the library: Download coreconst/php-dom-plus 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/ */
coreconst / php-dom-plus example snippets
use PhpDomPlus\Document;
$document = new Document();
$document->loadHTMLByUrl('http://example.com/');
$element = $document->querySelector('.example-class');
echo $element->innerHTML;
$element->classList->add('new-class');
echo $element->outerHTML;
bash
composer