20 function utf8_strcspn($str, $mask, $start = NULL, $length = NULL) {
22 if ( empty($mask) || strlen($mask) == 0 ) {
26 $mask = preg_replace(
'!([\\\\\\-\\]\\[/^])!',
'\\\${1}',$mask);
28 if ( $start !== NULL || $length !== NULL ) {
32 preg_match(
'/^[^'.$mask.
']+/u',$str, $matches);
34 if ( isset($matches[0]) ) {