When creating huge Internet applications it sometimes hard to keep your HTML code in good shape, especially if users are allowed to submit their articles or posts, there is always possibility of none closed tag or any similar small problem, with big consequences.
Basically there are two solutions for this problem, write complex scripts to check syntax of submitted text, or configure Tidy extension, write few lines of code and never think about it again. In my opinion second solution sounds more tempting, and in this article I want to show you how it is done.
But, before we start. What is Tidy extension? According to PHP manual: Tidy is a binding for the Tidy HTML clean and repair utility which allows you to clean and otherwise manipulate HTML documents.