私は日本語の文字を正常にエコーしていますが、文字列の一部を部分文字列にしてエコーアウトしようとすると、疑問符に変わります.��</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 �