public static function strspn($str, $mask, $start = null, $length = null)
    {
        if (!function_exists('utf8_strspn')) {
            require_once __DIR__ . '/phputf8/strspn.php';
        }

        if ($start === null && $length === null) {
            return utf8_strspn($str, $mask);
        }

        if ($length === null) {
            return utf8_strspn($str, $mask, $start);
        }

        return utf8_strspn($str, $mask, $start, $length);
    }
public static function strspn($str, $mask, $start = null, $length = null)
    {
        if (!function_exists('utf8_strspn')) {
            require_once __DIR__ . '/phputf8/strspn.php';
        }

        if ($start === null && $length === null) {
            return utf8_strspn($str, $mask);
        }

        if ($length === null) {
            return utf8_strspn($str, $mask, $start);
        }

        return utf8_strspn($str, $mask, $start, $length);
    }
public static function strspn ( $ str , $ mask , $ start = null , $ length = null ) { if ( ! function_exists ( 'utf8_strspn' ) ) { require_once __DIR__ . '/phputf8/strspn.php' ; } if ( $ start === null && $ length === null ) { return utf8_strspn ( $ str , $ mask ) ; } if ( $ length === null ) { return utf8_strspn ( $ str , $ mask , $ start ) ; } return utf8_strspn ( $ str , $ mask , $ start , $ length ) ; }
UTF-8 aware alternative to strspn
Find length of initial segment matching mask

@param   string  $str    The haystack
@param   string  $mask   The mask
@param   integer $start  Start optional
@param   integer $length Length optional

@return  integer

@see     http://www.php.net/strspn
@since   2.0
UTF - 8 aware alternative to strspn Find length of initial segment matching mask