mb_substr [ WordPress Function ]
mb_substr ( $str, $start, $length = null, $encoding = null )
| Defined at: |
|
Soorgelijke functies: _mb_substr, timer_start
No description yet.
Source
<?php
function mb_substr( $str, $start, $length=null, $encoding=null ) {
return _mb_substr($str, $start, $length, $encoding);
}
endif;
function _mb_substr( $str, $start, $length=null, $encoding=null ) {
// the solution below, works only for utf-8, so in case of a different
// charset, just use built-in substr
$charset = get_option( 'blog_charset' );
if ( !in_array( $charset, array('utf8', 'utf-8', 'UTF8', 'UTF-8') ) ) {
return is_null( $length )? substr( $str, $start ) : substr( $str, $start, $length);
}
// use the regex unicode support to separate the UTF-8 characters into an array
preg_match_all( '/./us', $str, $match );
$chars = is_null( $length )? array_slice( $match[0], $start ) : array_slice( $match[0], $start, $length );
return implode( '', $chars );
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- PHP: mb_substr - Manual
mb_substr — Get part of string ... mb_substr() returns the portion of str specified by the start and length ... add a note User Contributed Notes mb_substr ...
php.net - Server boru - PHP & mb_substr
Seems something has change on the server I'm allocated which has broken PHP -Fusion. does anyone know if the PHP will be rebuilt with ...
x10hosting.com - #12251 (mb_substr() works strangely in some environment ...
Summarizing above link: mb_substr() and mb_strlen() shows malfunction when dealing with non-English characters, because encoding parameter is not ...
core.trac.wordpress.org - Fatal error: Call to undefined function mb_substr() - statusnet
Hi My hosting provider transfer my site to VPS environment. I'm getting Fatal Error Fatal error: Call to undefined function mb_substr() .....
forum.status.net
Gebruikersdiscussies [ wordpress.org ]
- MichaelH on "Serious UTF-8 related issue in wp_html_excerpt() function"
- MichaelH on "I've told you about mb_substr() problem 2 weeks ago but nothing adopted to 2.9.2"
- MichaelH on "I've told you about mb_substr() problem 2 weeks ago but nothing adopted to 2.9.2"
- Cyrus H. on "I've told you about mb_substr() problem 2 weeks ago but nothing adopted to 2.9.2"
- mrmist on "I've told you about mb_substr() problem 2 weeks ago but nothing adopted to 2.9.2"
- Cyrus H. on "I've told you about mb_substr() problem 2 weeks ago but nothing adopted to 2.9.2"
- Cyrus H. on "Serious UTF-8 related issue in wp_html_excerpt() function"
- jam on "ASIAN text supporing problem"