Using tidy or DOMDocument as PHP Online HTML Validator

RJM Programming - March, 2022 - Thanks to https://www.php.net/manual/en/function.tidy-warning-count.php

No tidy module detected.

<p>first</p>
<p>test</i>2
<bogustag3>bogus</bogustag>
DOMDocument::loadHTML(); Error 76: Unexpected end tag : i at line 2 2, column 12
DOMDocument::loadHTML(); Error 801: Tag bogustag invalid at line 3 3, column 10

Number of elements detected is 5 ...

❌ <html><body><p>first</p> <p>test <bogustag>bogus</bogustag></p></body></html>
❌ <body><p>first</p> <p>test <bogustag>bogus</bogustag></p></body>
✔ <p>first</p>
❌ <p>test <bogustag>bogus</bogustag></p>
❓ <bogustag>bogus</bogustag>


Mac OS X or macOS MAMPWindows MAMP ... or ...PHP DOMDocument