Reputation: 1938
I have this code:
$string = "Perfect Valentine's Day Care Package | SpouseBuzz.com";
echo $string ."\n";
echo html_entity_decode($string) ."\n";
And it returns:
Perfect Valentine's Day Care Package | SpouseBuzz.com
Perfect Valentine's Day Care Package | SpouseBuzz.com
My question is: why html_entity_decode is not converting the html entity?
Thanks!
Upvotes: 0
Views: 262
Reputation: 76676
html_entity_decode()
by default will only convert double-quotes and will leave single-quotes alone. To also convert single-quotes to their corresponding character, add the ENT_QUOTES
flag:
echo html_entity_decode($string, ENT_QUOTES, 'UTF-8');
Upvotes: 3