Convert all HTML special chars to UTF-8 in PHP?
21,489
Use html_entity_decode()
and explicitly specify the charset:
$string = html_entity_decode($string, ENT_QUOTES, "utf-8");
for future reference: PHP string functions
Author by
Admin
Updated on January 24, 2020Comments
-
Admin over 4 years
Can somebody help me? How can i convert all HTML special chars to UTF-8 Example:
Hello Word! P&H
convert to:
Hello Word! P&H
-
BoltClock over 13 yearsWould be lovely if SO actually told me the very moment your answer shows up instead of waiting at least 1 whole minute or until I hit Post Your Answer...
-
Pekka over 13 years@BoltClock yeah, that mechanism is somehow broken, I've noticed too.