Source for file strspn.php
Documentation is available at strspn.php
* @version $Id: strspn.php,v 1.1 2007/09/09 20:39:49 pitlinz 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]) ) {
Documentation generated on Thu, 08 Jan 2009 17:48:36 +0100 by phpDocumentor 1.4.0a2