I want to check if is a string type multibyte on PHP. Have any idea how to accomplish this?
Example:
To determine if something is multibyte or not you need to be specific about which character set you're using. If your character set is Latin1, for example, no strings will be multibyte. If your character set is UTF-16, every string is multibyte.
That said, if you only care about a specific character set, say utf-8, you can use a mb_strlen < strlen test if you specify the encoding parameter explicitly.
function is_multibyte($s) {
return mb_strlen($s,'utf-8') < strlen($s);
}