I have a piece of code which generates a string which I wish to use to create an array;
The string is generated from a database quesry and looks something like this:
$array_str =
( "0_0" => array ("Automation Systems", "get.php?id=1", 1),
"0_1" => array ("Capital Products", "get.php?id=10", 1),
"0_2" => array ("Compounding /Safety", "get.php?id=19", 1),
"0_3" => array ("CPOE", "get.php?id=31", 1),
"0_4" => array ("Infusion Products", "get.php?id=40", 1),
"0_5" => array ("Services", "get.php?id=53", 1),
"0_6" => array ("Software /Hardware", "get.php?id=63", 1),
"0_7" => array ("Unit Dose", "get.php?id=76", 1));
I would like to create an array using the string but am not getting anywhere.
The following just prints (but doesn't create) the array:
$create_array = $thisarray . " = array(" . $array_str . ")";
print $create_array;
How can I create an array using the string?
Many thanks for any help.
Patty