I used stackoverflow to find solution to my problems, so I didn't need to post a question so long. I search for a way to output HTML code but as many of you answered HTMLPurifier is the best solution around.
I find it hard to believe that this is the only way, like isn't supposed that PHP thought on how to clean the input from XSS attacks but still output data?
Htmlentities, htmlspecialchars, strip_tags are not the best candidates for this.
So, the question is: What is?
What I am trying to do is to output user's HTML data from MYSQL safely.