POMO_Reader::substr() WordPress Method
The POMO_Reader::substr() WordPress method is used to get a part of a string. It is similar to the substr() function in PHP, except that it takes into account the UTF-8 encoding of the string.
POMO_Reader::substr( string $string, int $start, int $length ) #
Parameters
- $string
(string)(Required)
- $start
(int)(Required)
- $length
(int)(Required)
Return
(string)
Source
File: wp-includes/pomo/streams.php
public function substr( $string, $start, $length ) {
if ( $this->is_overloaded ) {
return mb_substr( $string, $start, $length, 'ascii' );
} else {
return substr( $string, $start, $length );
}
}
Expand full source codeCollapse full source codeView on TracView on GitHub