This seems like a simple task, but I haven't been able to find a way to do this. I have an output of data stored as a string like this:
$rawData = "array('first' => '$first', 'middle' => '$middle', 'last' => '$last')";
What I simply need to do is convert it to this array:
$arrData = array('first' => "$first", 'middle' => "$middle", 'last' => "$last");
The closest I have been able to get is this shown below with print_r results:
$Data = explode(',', $rawData);
Array
(
[0] => 'first' => '$first'
[1] => 'middle' => '$middle'
[2] => 'last' => '$last'
)
What I need is this:
Array
(
[first] => $first
[middle] => $middle
[last] => $last
)
Must be something very easy I have overlooked. Please help.