Auto repair XHTML code with PHP

Tidy PHP extension allows to automate fix XHTML and XML code. I wrote Symfony Plugin that provides automated code repair (ex. users input from TinyMCE or FCKEditor). The sfTidyHelper produce valid XHTML or XML code. If you done use Symfony you will find in this entry function repairing broken code.

To automaticaly cleanup and repair xhtml code (ex. from textarea or input tag) use Tidy extesnion for PHP.
Sample broken code which can be fixed

1
<p>ala <b> ma kota & psa<br />Lorem ipsum

to valid XHTML:

1
<p>ala <b> ma kota &amp; psa<br />Lorem ipsum</b></p>

Simple function which repair wrong code: Continue reading “Auto repair XHTML code with PHP”