Title: POMO_StringReader::read
Published: April 25, 2014
Last modified: April 28, 2025

---

# POMO_StringReader::read( string $bytes ): string

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/pomo_stringreader/read/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/pomo_stringreader/read/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/pomo_stringreader/read/?output_format=md#source)

[ Back to top](https://developer.wordpress.org/reference/classes/pomo_stringreader/read/?output_format=md#wp--skip-link--target)

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/pomo_stringreader/read/?output_format=md#parameters)󠁿

 `$bytes`stringrequired

## 󠀁[Return](https://developer.wordpress.org/reference/classes/pomo_stringreader/read/?output_format=md#return)󠁿

 string

## 󠀁[Source](https://developer.wordpress.org/reference/classes/pomo_stringreader/read/?output_format=md#source)󠁿

    ```php
    public function read( $bytes ) {
    	$data        = $this->substr( $this->_str, $this->_pos, $bytes );
    	$this->_pos += $bytes;
    	if ( $this->strlen( $this->_str ) < $this->_pos ) {
    		$this->_pos = $this->strlen( $this->_str );
    	}
    	return $data;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/pomo/streams.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/pomo/streams.php#L268)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/pomo/streams.php#L268-L275)

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fpomo_stringreader%2Fread%2F)
before being able to contribute a note or feedback.