[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @package utf8 4 */ 5 6 //--------------------------------------------------------------- 7 /** 8 * UTF-8 aware alternative to strspn 9 * Find length of initial segment matching mask 10 * Note: requires utf8_strlen and utf8_substr (if start, length are used) 11 * @param string 12 * @return int 13 * @see http://www.php.net/strspn 14 * @package utf8 15 */ 16 function utf8_strspn($str, $mask, $start = NULL, $length = NULL) { 17 18 $mask = preg_replace('!([\\\\\\-\\]\\[/^])!','\\\$1}',$mask); 19 20 // Fix for $start but no $length argument. 21 if ($start !== null && $length === null) { 22 $length = utf8_strlen($str); 23 } 24 25 if ( $start !== NULL || $length !== NULL ) { 26 $str = utf8_substr($str, $start, $length); 27 } 28 29 preg_match('/^['.$mask.']+/u',$str, $matches); 30 31 if ( isset($matches[0]) ) { 32 return utf8_strlen($matches[0]); 33 } 34 35 return 0; 36 37 } 38
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |