30 return mb_strlen($string,
'UTF-8');
44 return mb_substr($string, $offset, $length,
'UTF-8');
61 return mb_strtolower($string,
'UTF-8');
78 return mb_strtoupper($string,
'UTF-8');
93 return mb_strpos($haystack, $needle, $offset,
'UTF-8');
108 return mb_stripos($haystack, $needle, $offset,
'UTF-8');
126 preg_match(
'/^(.{1})(.*)$/us', $string, $matches);
141 if (strlen($string) == 0) {
148 return (
bool) preg_match(
'/^.{1}/us', $string);
169 $bad =
'([\x00-\x7F]' 170 .
'|[\xC2-\xDF][\x80-\xBF]' 171 .
'|\xE0[\xA0-\xBF][\x80-\xBF]' 172 .
'|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}' 173 .
'|\xED[\x80-\x9F][\x80-\xBF]' 174 .
'|\xF0[\x90-\xBF][\x80-\xBF]{2}' 175 .
'|[\xF1-\xF3][\x80-\xBF]{3}' 176 .
'|\xF4[\x80-\x8F][\x80-\xBF]{2}' 179 while (preg_match(
'/' . $bad .
'/S', $string, $matches)) {
180 if (!isset($matches[2])) {
181 $result .= $matches[0];
185 $string = substr($string, strlen($matches[0]));
utf8_substr($string, $offset, $length=null)
utf8_strpos($haystack, $needle, $offset=0)
utf8_bad_replace($string, $replace='?')
utf8_stripos($haystack, $needle, $offset=0)