PHP code example of chillerlan / php-prototype-dom
1. Go to this page and download the library: Download chillerlan/php-prototype-dom 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/ */
chillerlan / php-prototype-dom example snippets
use chillerlan\PrototypeDOM\Document;
use chillerlan\PrototypeDOM\Node\PrototypeHTMLElement;
$document = new Document(file_get_contents('https://www.php.net/supported-versions.php'));
$supportedVersions = $document->querySelectorAll('tr.stable > td:first-of-type > a')
->map(fn(PrototypeHTMLElement $a):string => $a->value());
var_dump($supportedVersions); // -> ['7.4', '8.0']
json
{
": "^7.4 || ^8.0",
"chillerlan/php-prototype-dom": "dev-main"
}
}