I have a string in UTF-8.
$string = "ãçé êíõ";
I need to find the position of the space.
I have to use mb_strpos($string,' ');
?
I have a string in UTF-8.
$string = "ãçé êíõ";
I need to find the position of the space.
I have to use mb_strpos($string,' ');
?
If you want to find the character position of the space, then yes. strpos
will not do because the byte value 0x20
(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_strpos
call or by setting a default with mb_internal_encoding
.