I have an field name that is passed to me via an ajax function which i need to use to lookup values in an existing array. e.g.
$myarray = array(
'name' => array(
'0' => array(
'first' => 'Steve'
)
),
);
$incoming = 'name[0][first]';
So using the $incoming variable i wanted to get the corresponding data out of the array but cant figure out how to convert the string into the array indicies lookup.
Im trying to come up with a method that will work regardless of the level of nesting in the array.
$incoming = $myarray['name'][0]['first']and$myarray["name"][0]["first"]works as well.