I have this array:
$age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
And it prints, which is all right:
Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
But I want to do add values from a string, like this:
$string = '"Peter"=>"35", "Ben"=>"37", "Joe"=>"43"';
$age = array($string);
The problem is that it prints:
Array ( [0] => "Peter"=>"35", "Ben"=>"37", "Joe"=>"43" )
I don't want this:
[0] =>
And the keys are not right. It don't turn the "" to []:
Right: [Peter] => ...
Wrong: "Peter" => ...
How can I proceed?