A_Z_Listing_Grouping::maybe_mb_substr( string $string, int $start, int $length )

Perform a multibyte substring operation if mbstring is loaded, else use substr.




(string) (Required) The string to extract the substring from.


(int) (Required) Start the substring at this character number (starts at zero).


(int) (Required) Number of characters to include in the substring.


File: classes/class-a-z-listing-grouping.php

	public static function maybe_mb_substr( $string, $start, $length ) {
		if ( extension_loaded( 'mbstring' ) ) {
			return mb_substr( $string, $start, $length, 'UTF-8' );
		return substr( $string, $start, $length );


Version Description
2.1.0 Introduced.

More Information

You are currently logged out. To view tickets you must first login.

I have read and understood the Terms of Service

User Contributed Notes

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.