19 function utf8_strspn($str, $mask, $start = NULL, $length = NULL) {
21 $mask = preg_replace(
'!([\\\\\\-\\]\\[/^])!',
'\\\${1}',$mask);
24 if ($start !== null && $length === null) {
28 if ( $start !== NULL || $length !== NULL ) {
32 preg_match(
'/^['.$mask.
']+/u',$str, $matches);
34 if ( isset($matches[0]) ) {