Source for file strcspn.php
Documentation is available at strcspn.php
* @version $Id: strcspn.php,v 1.1 2007/09/09 20:39:49 pitlinz Exp $
//---------------------------------------------------------------
* UTF-8 aware alternative to strcspn
* Find length of initial segment not matching mask
* Note: requires utf8_strlen and utf8_substr (if start, length are used)
* @see http://www.php.net/strcspn
function utf8_strcspn($str, $mask, $start =
NULL, $length =
NULL) {
if ( empty($mask) ||
strlen($mask) ==
0 ) {
$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