<?php $str = 'محمد'; var_dump(mb_substr($str, 0, 1, 'utf8'));
Standard input is empty
string(2) "م"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!