CakePHP has a global function called h . This is a convenient method for htmlspecialchars . CakePHP also has a Sanitize utility that has an html method. Here is part of his description:
This method prepares user data for display inside HTML. This is especially useful if you do not want users to be able to layout or paste images or scripts inside your HTML pages.
When should everyone be used? Better than the other?
source share