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"
}
$str[0]
would return 'a'. You cannot use foreach or any of the array functions on it though then. – Gordon♦ Jul 19 '10 at 7:55