Source code for file /phputf8/strspn.php
Documentation is available at strspn.php
* @version $Id: strspn.php,v 1.1 2006/02/25 13:50:17 harryf Exp $
//---------------------------------------------------------------
* UTF-8 aware alternative to strspn
* Find length of initial segment matching mask
* Note: requires utf8_strlen and utf8_substr (if start, length are used)
* @see http://www.php.net/strspn
function utf8_strspn($str, $mask, $start =
NULL, $length =
NULL) {
$mask =
preg_replace('!([\\\\\\-\\]\\[/^])!','\\\${1}',$mask);
if ( $start !==
NULL ||
$length !==
NULL ) {
if ( isset
($matches[0]) ) {