If you are building a website that needs to have its content managed by non-technical users, then it cannot be expected that they will learn how to write perfect XHTML. For example, it is quite common to see a user forget to close a tag, or if they do, they might do it in the wrong order.
The purpose of this script is to take user generated text, which contains formatting tags, and for it to be converted into perfectly valid XHTML.
To see the features available, then please read the help file.
If your website uses PHP, and you think this script might be useful, you can download a copy of the source code, which contains instructions at the beginning on how to include it.
Any feedback would be greatly appreciated. If you would like to use this code, please read the licence it is released under.