0
我有一個數據庫在幾個字段中包含重音字母(如「é」等)。如果我贊同那些關於我的網頁,他們顯示正確的,因爲我用這個HTML標籤,當我使我的html:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
但是,當我想從我的網址與$ _GET顯示從參數值時,它不起作用。
我用這個代碼:
$fname = $_GET['fname'];
實際輸出:
groté
所需的輸出:
Groté
編碼看起來沒給我,我檢查了它使用此代碼:
var_dump($fname);
var_dump(iconv_get_encoding('all'));
輸出:
string(6) "groté"
array(3) { ["input_encoding"]=> string(10) "ISO-8859-1" ["output_encoding"]=> string(10) "ISO-8859-1" ["internal_encoding"]=> string(10) "ISO-8859-1" }
其中I設置在PHP編碼我不使用的代碼。我只使用元標記,如上所述。
我的代碼有什麼問題?
你的代碼沒有問題。網站不能使用ISO-8859-1編碼處理特殊字符。改爲使用UTF-8編碼。 –