Since I have to output a lot of variables to the client in php, I always have to constantly type:
Code: Select all
$var = 'test'
echo stripslashes(htmlentities($var, ENT_QUOTES, 'UTF-8'));Code: Select all
function outputThis($outputString)
{
$sendToBrowser = stripslashes(htmlentities($outputString, ENT_QUOTES, 'UTF-8'));
return $sendToBrowser;
}echo outputThis($var);
Do any of you guys see any problems with my code? I want to make sure I leave no stone unturned since I am putting it up live for public. Thanks for your review.