Heres my code:
$string = 'It';
$string = html_entity_decode($string);
echo $string;
It should be echoing “It”, but its just echoing the ASCII codes. Am I using the wrong function? I also tried htmlspecialchars_decode and it changes nothing.
Those are not valid entitiesActually, they are valid in HTML 4 (and I suppose HTML5 too), but in this case the entities need to be semicolon-terminated for PHP to recognize them:htmlspecialchars_decode()only decodes<,>,&,'and"(and the last two depend on the quotes flag).