Folks
I have the following variable:
$varstring = '"'.$key.'"=>"'.$val.'"';
Which resolves to :
"key"=>"value"
When I try to create an array using
$newarray = array ($varstring);
I get
[0]=>"key"=>"value"
and I cant reference the index for my array
$newarray['key'];
BUT when i create the array subsituting the variable for its contents
$newarray = array ("key"=>"value");
it all works fine.
How do I create the array so that I can use my $key and $value variables as data?
Many Thanks