String to Array
I was wondering if there was a way to convert a string back into an array, like say:
$foo = array("vegetable" => "apple", "fruit" => "grape");
$array = print_r($foo, true);
$array = string_to_array($array);
print $array['vegetable'];
It's not difficult to create that for me, but when I get into deep multidimensional arrays I'm lost as to how to develop those loops. I can get all the values fine but everything I can think of won't retain the embedded array's key.
Thanks for any help.
|