2010-04-27 56 views

回答

0

您需要指定您使用的字符集作爲htmlentities()的第三個參數。默認字符集是iso-8859-1。如果您使用UTF-8爲您的數據,你需要這樣說:

$result = htmlentities($string, ENT_QUOTES, "UTF-8"); 
1

確保您的頁面字符集設置爲utf-8

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />