POMO_Reader::str_split( string $input_string, int $chunk_size ): array

In this article

Parameters

$input_stringstringrequired
$chunk_sizeintrequired

Return

array

Source

public function str_split( $input_string, $chunk_size ) {
	if ( ! function_exists( 'str_split' ) ) {
		$length = $this->strlen( $input_string );
		$out    = array();
		for ( $i = 0; $i < $length; $i += $chunk_size ) {
			$out[] = $this->substr( $input_string, $i, $chunk_size );
		}
		return $out;
	} else {
		return str_split( $input_string, $chunk_size );
	}
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.