WordPress at Your Fingertips
function is not described

WC_Geo_IP::_safe_substr() private WC 1.0

Encode string.

{} It's a method of the class: WC_Geo_IP{}

No Hooks.

Return

String.

Usage

// private - for code of main (parent) class only
$result = $this->_safe_substr( $string, $start, $length );
$string(string) (required)
-
$start(int) (required)
-
$length(int) (required)
-

Code of WC_Geo_IP::_safe_substr() WC 5.8.0

private function _safe_substr( $string, $start, $length ) {
	// workaround php's broken substr, strpos, etc handling with
	// mbstring.func_overload and mbstring.internal_encoding
	$mb_exists = extension_loaded( 'mbstring' );

	if ( $mb_exists ) {
		$enc = mb_internal_encoding();
		mb_internal_encoding( 'ISO-8859-1' );
	}

	$buf = substr( $string, $start, $length );

	if ( $mb_exists ) {
		mb_internal_encoding( $enc );
	}

	return $buf;
}