# \[PHP\] Dynamicly tidy HTML to XHTML (without php tidy ext.)

**URL:** https://forum.kirupa.com/t/php-dynamicly-tidy-html-to-xhtml-without-php-tidy-ext/77386
**Category:** programming
**Created:** [January 26, 2005, 9:59pm UTC](https://forum.kirupa.com/t/php-dynamicly-tidy-html-to-xhtml-without-php-tidy-ext/77386 "2005-01-26T21:59:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![koorb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/koorb/32/424_2.png) [@koorb](https://forum.kirupa.com/u/koorb)
#### Post date: [January 26, 2005, 9:59pm UTC](https://forum.kirupa.com/t/php-dynamicly-tidy-html-to-xhtml-without-php-tidy-ext/77386/1 "2005-01-26T21:59:35Z")

</div>

Ok so I thought this would be dead easy quick google, but I cant seem to find anything.

Basicly I want to convert a string (document) of HTML into valid XHTML including styles rather than \<font\> etc. Thing is I want to do it dynamicly with PHP, I have seen the tidy extention for php, but it’s not really practical for my application (I want it to be easy to install - independant of extentions) .

I am using [http://tinymce.moxiecode.com/](http://tinymce.moxiecode.com/) which in itself seems a tidy editor but doen’t produce valid XHTML. I just wanted a php class to do this for me and I dont have time to write my own!

Anyone know of anything ?

Thanks much.
