Is it possible to take an array of values, for example:
$index = array('0' => '1', '1' => '4', '2' => '7');
And use this to update the position of another array at position $update['1']['4']['7']?
I thought maybe I could do something like the below (but it seems that I can’t)…
for($build_key=0;$build_key<3; $build_key++){
$this_key .= "[".$index[$build_key]."]";
}
$update.$this_key = 'new data in';
Update
I’m not sure how many levels the array will have, which is why I’ve tried to use a for loop (i’ve put ‘3’ above in the for loop though maybe i should have used count($index) instead.
Like this?
This will work for any length array: