{"id":19526345,"url":"https://github.com/phpfui/phpfuiwebsite","last_synced_at":"2025-06-30T23:06:19.908Z","repository":{"id":39756613,"uuid":"231153229","full_name":"phpfui/PHPFUIWebsite","owner":"phpfui","description":"PHPFUI documentation","archived":false,"fork":false,"pushed_at":"2025-06-21T05:22:22.000Z","size":22496,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-21T06:26:13.411Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phpfui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-12-31T22:37:14.000Z","updated_at":"2025-06-21T05:22:26.000Z","dependencies_parsed_at":"2025-06-21T06:32:19.840Z","dependency_job_id":null,"html_url":"https://github.com/phpfui/PHPFUIWebsite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phpfui/PHPFUIWebsite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpfui%2FPHPFUIWebsite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpfui%2FPHPFUIWebsite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpfui%2FPHPFUIWebsite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpfui%2FPHPFUIWebsite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpfui","download_url":"https://codeload.github.com/phpfui/PHPFUIWebsite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpfui%2FPHPFUIWebsite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262864133,"owners_count":23376455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T01:09:35.993Z","updated_at":"2025-06-30T23:06:19.855Z","avatar_url":"https://github.com/phpfui.png","language":"PHP","readme":"html-validator\n==============\n\nPHP client for the [validator.nu](https://validator.nu/) API. Can be configured to use a self-hosted version of the API.\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/rexxars/html-validator.svg?style=flat-square)](https://packagist.org/packages/rexxars/html-validator)[![PHP Version](https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg?style=flat-square)](https://php.net)[![License](https://img.shields.io/github/license/rexxars/html-validator.svg?style=flat-square)](https://packagist.org/packages/rexxars/html-validator)[![Build Status](https://img.shields.io/travis/rexxars/html-validator/master.svg?style=flat-square)](https://travis-ci.org/rexxars/html-validator)\n\nVersion \u003e= 2.0.0 requires PHP \u003e= 5.6.  \nVersion \u003c= 1.1.0 supports PHP \u003c= 5.6, but won't be maintained anymore.\n\n# Usage\n\n```php\n\u003c?php\n$document = file_get_contents('my-page.html');\n\n$validator = new HtmlValidator\\Validator();\n$result = $validator-\u003evalidateDocument($document);\n\n$result-\u003ehasErrors();   // true / false\n$result-\u003ehasWarnings(); // true / false\n\n$result-\u003egetErrors();   // array(HtmlValidator\\Message)\n\necho $result;           // Prints all messages in human-readable format\necho $result-\u003etoHTML(); // Prints all messages HTML-formatted\n```\n\n# Installing\n\nTo include `html-validator` in your project, add it to your `composer.json` file:\n\n```json\n{\n    \"require\": {\n        \"rexxars/html-validator\": \"^2.2.0\"\n    }\n}\n```\n\n# Example\n\nDocument to be validated (`validate-me.html`):\n``` html\n\u003c!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\"\u003e\n\u003chtml\u003e\n\u003chead\u003e\n    \u003ctitle\u003eInvalid HTML4!\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003cp\u003eThis document is not a proper, well-formed HTML4 document!\u003c/p\u003e\n    \u003cp\u003eIt contains fatal flaws, like:\u003c/p\u003e\n    \u003cul\u003e\n        \u003cli\u003e\u003cdiv\u003e tags which are not closed\u003c/li\u003e\n        \u003cli\u003espan-tags which are never opened are attempted closed \u003c/span\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nUsing the validator:\n```php\n\u003c?php\n$document = file_get_contents('validate-me.html');\n\n$validator = new HtmlValidator\\Validator();\n$validator-\u003esetParser(HtmlValidator\\Validator::PARSER_HTML4);\n$result = $validator-\u003evalidateDocument($document);\n\necho $result;\n```\n\nOutput:\n```\ninfo: HTML4-specific tokenization errors are enabled.\n\n\nerror: End tag “li” seen, but there were open elements.\nFrom line 10, column 44; to line 10, column 48\nnot closed\u003c/li\u003e\n\n\nerror: Unclosed element “div”.\nFrom line 10, column 13; to line 10, column 17\n      \u003cli\u003e\u003cdiv\u003e tags\n\nerror: Stray end tag “span”.\nFrom line 11, column 67; to line 11, column 73\ned closed \u003c/span\u003e\u003c/li\u003e\n\n```\n\n# Validating a URL\n\nSince 1.1.0 you can validate URLs as well:\n\n```php\n\u003c?php\n$validator = new HtmlValidator\\Validator();\n$validator-\u003esetParser(HtmlValidator\\Validator::PARSER_HTML5);\n$result = $validator-\u003evalidateUrl($url);\n\necho $result;\n```\n\nNote that if you want to check pages that return status codes that are not in the 2xx-range (like a 404-page), you need to pass a `checkErrorPages` option:\n\n```php\n$validator = new HtmlValidator\\Validator();\n$validator-\u003esetParser(HtmlValidator\\Validator::PARSER_HTML5);\n$result = $validator-\u003evalidateUrl($url, ['checkErrorPages' =\u003e true]);\n\necho $result;\n```\n\n# Using a self-hosted version of the API\n\nCheck out [validator.nu](http://about.validator.nu/#src) for instructions on setting up the service.\nOnce set up, you can configure the validator to use a different host:\n\n```php\n\u003c?php\n$validator = new HtmlValidator\\Validator('http://self-hosted-validator.domain.com');\n\n```\n\n# License\n\nMIT licensed. See LICENSE for full terms.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpfui%2Fphpfuiwebsite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpfui%2Fphpfuiwebsite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpfui%2Fphpfuiwebsite/lists"}