gemorroj / htmlvalidator
W3C HTML Validator service.
Installs: 2 432
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/gemorroj/htmlvalidator
Requires
- php: >=8.1
- symfony/http-client: ^7.4||^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.93
- phpunit/phpunit: ^11.5||^12.5
README
Rewritten to use the new API https://validator.w3.org/docs/api.html
Requirements:
- PHP >= 8.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());