htmlspecialchars in PHP
htmlspecialchars is a PHP function that serves to provide security against cross-site scripting (XSS) attacks. This function was added in PHP version 4.3.0 and has better recursion protection than the htmlentities function, the difference between both being that htmlentities translates everything except < and & …