Sunday, September 16, 2012

htmlspecialchars is not working


Error


The following code 
----------------------------------------------------------
$str = "A 'quote' is \"\"";
echo htmlspecialchars($str);
echo htmlspecialchars($str, ENT_QUOTES);
----------------------------------------------------------

Produced

A 'quote' is ""
A 'quote' is ""


Solution

My Case: It was a Firefox problem, the "View Selection Source" WAS DECODING THE CHARS BACK


No comments:

Post a Comment