Parameters
$input_string
stringrequired$chunk_size
intrequired
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.