1. Go to this page and download the library: Download rexxars/html-validator 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/ */
rexxars / html-validator example snippets
$document = file_get_contents('my-page.html');
$validator = new HtmlValidator\Validator();
$result = $validator->validateDocument($document);
$result->hasErrors(); // true / false
$result->hasWarnings(); // true / false
$result->getErrors(); // array(HtmlValidator\Message)
echo $result; // Prints all messages in human-readable format
echo $result->toHTML(); // Prints all messages HTML-formatted