PHP code example of phpgt / dom

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

    

phpgt / dom example snippets



use Gt\Dom\HTMLDocument;
use Gt\Dom\HTMLElement\HTMLSpanElement;
$html);

if(isset($_GET["name"])) {
	$span = $document->querySelector(".name-output");
	$span->innerText = $_GET["name"];
}

echo $document;