substr with japanese characters issue

Viewed 4332

i'm echoing japanese characters fine but when i try to substr and echo out part of the string it just turn to question marks ���

note: i set my header to utf-8

header('Content-Type: text/html; charset=utf-8');

and made the meta <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 �
3 Answers
Related