问题
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
回答1:
Use html_entity_decode() and explicitly specify the charset:
$string = html_entity_decode($string, ENT_QUOTES, "utf-8");
for future reference: PHP string functions
来源:https://stackoverflow.com/questions/4775842/convert-all-html-special-chars-to-utf-8-in-php