tags:

views:

58

answers:

1

How can I convert a string to an array? For instance, I have this string:

$str = 'abcdef';

And I want o get:

array(6) {
  [0]=>
  string(1) "a"
  [1]=>
  string(1) "b"
  [2]=>
  string(1) "c"
  [3]=>
  string(1) "d"
  [4]=>
  string(1) "e"
  [5]=>
  string(1) "f"
}
+6  A: 

Use str_split http://www.php.net/manual/en/function.str-split.php

robertbasic