PDA

Click to See Complete Forum and Search --> : Format HTML


john tindell
Feb 26th, 2005, 10:58 AM
Hey does anyone know of a way to format HTML correcly

I have

<b>This</b> is a<b> test <u></b>document</u> that will be <b>displayed </b>via <u><b>PHP</u></b>

and want it formatted like

<b>This</b> is a <b>test</b> <u>document</u> that will be <b>displayed</b> via <b><u>PHP</u></b>


Any ideas?

Thanks

visualAd
Feb 26th, 2005, 01:29 PM
You need the HTML tidy extension http://uk2.php.net/tidy ;)

What tidy won't do is clean up badly formed HTML, as it can be somewhat ambiguous. You can hwoever get it to scan a file (or string) and output all the erros found.