I have a string in UTF-8.
$string = "ãçé êíõ";
I need to find the position of the space.
I have to use mb_strpos($string,' '); ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to find the character position of the space, then yes.
strposwill not do because the byte value0x20(UTF-8 code point for space) can also be encountered as part of a code point encoded over multiple bytes.Also, do not forget to specify the encoding — either explicitly on the
mb_strposcall or by setting a default withmb_internal_encoding.