I need to convert HTML4 input to valid XHTML (strict) in PHP5 for further processing (e.g. SAX). Any suggestions?
The PHP Tidy extension should be able to do the job.
Here is a good article on this: Correcting HTML with the Tidy PHP extension .