如何将Á转换为A.

时间:2015-11-02 07:36:16

标签: php

我正在尝试将Ágætis字符转换为普通字母,但要获得 g tis。

echo "<tr><td>"; 
echo iconv('UTF-8', 'ISO-8859-1//TRANSLIT//IGNORE', $CDTitle);
echo "<div> 
<a href = \"editCDForm.php?itemCode=$iCDID\">$CDTitle</a> 
</div>\n";
echo "</td><td>";   
echo $row['CDYear'];
echo "</TD></tr>"; 

3 个答案:

答案 0 :(得分:0)

试试这个

  iconv('utf-8', 'ascii//TRANSLIT', $CDTitle);

How to convert special characters to normal characters?

答案 1 :(得分:0)

Reference尝试使用php iconv

echo iconv('utf-8', 'ascii//TRANSLIT', 'Ágætis');

Demo

  

iconv - 将字符串转换为请求的字符编码

     

string iconv(string $ in_charset,string $ out_charset,string $ str   )

答案 2 :(得分:0)

谢谢大家,以下帮助解决转换角色

header('Content-type:text / html; charset = iso-8859-1');