How can I convert a string to an array? For instance, I have this string:
$str = \'abcdef\';
And I want to get:
array(6) {
Note that starting with php 5.5 you can refer to string characters by array indices, which in most cases prevents need for the solution(s) above.
$str = 'abdefg'; echo $str[4]; // output: f