Counts the number of characters in a UTF-8 string.
This is less than or equal to the byte count.
string $text: The string to run the operation on.
int The length of the string.
public static function strlen($text) {
if (static::getStatus() == static::STATUS_MULTIBYTE) {
return mb_strlen($text);
}
else {
// Do not count UTF-8 continuation bytes.
return strlen(preg_replace("", '', $text));
}
}