I have a problem when i need to change an array value and i dont know in advance exactly what value.
Its for a filteringclass for a system that parses articles to an xml-feed.

I've taken the part where im in trouble out, since it would be too much to include everything in the system.
This is just a testcase really, so names on variables are not as in real life

The code is commented so you can just follow it:

PHP Code:
// This is the key we want to change
$path = array("info""data");

// This is the original array
$test = array
"id" => 1,
"name" => "testing",
"info" => array
"data" => "some data here yes"

// Lets create some copies/references to work with
$test2 $test;
$test3 =& $test;

foreach (
$path as $node) {
$test2 $test2[$node];
// $test2 now should contain "some data here yes"
// So how do we change it, references naturaly falls to mind
// So i rewrite the foreach a bit so it works like this:
foreach ($path as $node) {
$test2 $test2[$node];
$test3 $test3[$node];
// Now i have $test2 just like it was, and $test3 should be a reference to $test['info']['data']
// But wait, i have overwritten $test on the way, so now $test is useless, thus also any reference i have.
// What i want is the following
$test3 $test['info']['data'];

// And nope, i cant hardcode it :/ 
Any help would really be appreciated, im totaly stuck here.
I am open to any solution there might be.