Given I have a php script of arbitrary complexity, running on an apache2 webserver, and I want to check that this script outputs only valid xhtml.
One way to achieve this that occurred to me was validating the output of this php script IN the script every time it is run, and storing generated errors and warnings in a mysql database.
Is this possible?
Thanks!
EDIT: I guess the main problem here is getting the output of the current script without rewriting every echo call.
EDIT2: I’d prefer the w3c sgml validation over html tidy.
You can not only check but also fix common errors using tidy
Example from http://www.php.net/manual/en/tidy.parsestring.php
This will output: