gemorroj/htmlvalidator

W3C HTML Validator service.

3.3.0 2023-12-22 13:45 UTC

This package is auto-updated.

Last update: 2024-11-27 12:36:54 UTC


README

Continuous Integration

Rewritten to use the new API https://validator.w3.org/docs/api.html

Requirements:

  • PHP >= 8.0.2

Installation:

composer require gemorroj/htmlvalidator

Example:

<?php
use HTMLValidator\HTMLValidator;

$validator = new HTMLValidator();
$result = $validator->validateFragment('<html lang="en"><body> </body></html>');
$result = $validator->validateFile('/path/to/file.html');
$result = $validator->validateUri('http://example.com');

var_dump($result->isValid());

print_r($result->getErrors());
print_r($result->getWarnings());