Lines Matching refs:length
175 * @param int $length (optional) length in UTF-8 characters from offset
178 function utf8_substr($str, $offset, $length = null) { argument
180 if( $length === null ){
183 return mb_substr($str, $offset, $length);
204 if (!is_null($length)) $length = (int)$length;
207 if ($length === 0) return '';
208 if ($offset < 0 && $length < 0 && $length < $offset) return '';
232 if (is_null($length)) {
239 if ($length > 0) {
241 …$length = min($strlen-$offset, $length); // reduce any length that would go passed the end of the…
243 $Lx = (int)($length/65535);
244 $Ly = $length%65535;
250 } else if ($length < 0) {
252 if ($length < ($offset - $strlen)) return '';
254 $Lx = (int)((-$length)/65535);
255 $Ly = (-$length)%65535;
279 …* @param int $length If given and is positive, it represents the length of the portion of …
284 function utf8_substr_replace($string, $replacement, $start , $length=0 ){ argument
288 $ret .= utf8_substr($string, $start+$length);
545 $length = null;
547 while (is_null($length) || $length < $offset) {
553 $length = utf8_strlen(substr($haystack, 0, $pos));
555 if ($length < $offset)
556 $comp = $pos - $length;
559 return $length;