我很好地回显日文字符,但是当我尝试 substr 并回显部分字符串时,它只会变成问号 ��</p>
注意:我将标题设置为 utf-8
header('Content-Type: text/html; charset=utf-8');
并制作了元
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
$word = "せんせい";
echo $word; //works just fine
echo substr($word,-1); //now it just echoes �
//this one also failed
echo $word[0]; //echoes �