php - Convert both, Unicode entities and HTML entities -


after spending entire morning going through questions on stack overflow, i'm seeking help. need convert both, unicode entities , html entities utf-8 text.

$string = "let's "kiss & makeup""; //-> let's kiss & makeup "lalala" 

i manage decode html entities alone (using html_entity_decode() , htmlspecialchars_decode). not linked polyfill trick. since none of functions tried decoded unicode entities, haven't tried figuring out how combination of decoding functions.

the issue single quotes , default ent_compat flag of html_entity_decode, "leaves single-quotes alone". set ent_quotes flag instead convert quotes:

echo html_entity_decode($string, ent_quotes | ent_html401, 'utf-8'); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -