What is str_split?

str_split : Convert a string to an array

<?php
$str = “Anwar Hossain”;
$arr1 = str_split($str);
$arr2 = str_split($str, 3);
print_r($arr1);
print_r($arr2);
?>

OUTPUT:

Array
(
[0] => A
[1] => n
[2] => w
[3] => a
[4] => r
[5] =>
[6] => H
[7] => o
[8] => s
[9] => s
[10] => a
[11] => i
[12] => n
)

Array
(
[0] => Anw
[1] => ar
[2] => Hos
[3] => sai
[4] => n
)