Split a string into an array of character pairs

Possible duplicate:
PHP preg_split string in a couple of letters

I have a line that looks like this:

$str = "How are you doing?";

How can I turn this string into an array that looks like this:

$arr = array("Ho","w ","ar","r ","yo","u ","do","in","g?");
+5
source share
3 answers
$array = str_split($str, 2);

Documentation .

+9
source
+4
source

str_split(); , :

$arr = str_split($str, 2);

$str $arr, ,

+2

All Articles