WC_Geo_IP::_safe_substr()
Encode string.
Метод класса: WC_Geo_IP{}
Хуков нет.
Возвращает
Строку
.
Использование
// private - только в коде основоного (родительского) класса $result = $this->_safe_substr( $string, $start, $length );
- $string(строка) (обязательный)
- -
- $start(int) (обязательный)
- -
- $length(int) (обязательный)
- -
Код WC_Geo_IP::_safe_substr() WC Geo IP:: safe substr WC 9.7.1
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; }