PHP 5 includes support for the useful Tidy (http://tidy.sf.net/) library. It enables PHP developers to parse, diagnose, clean, and repair HTML dоcuments. The Tidy extension supports both a functional and an OO interface, and its API uses the PHP 5 exception mechanism