A bit unusual use-case but maybe you can help:
I have the keys of an value as a separate array. It is pretty easy to get the value of the array with it like this:
function whatEver(){
$array = array(
0 => array( 'other' ),
1 => array(
0 => array( 'other' ),
1 => array( 'value' )
),
);
$keys = array(
0 => '1',
1 => '1'
);
$result = $array;
foreach($keys as $key)
{
$result = $result[$key];
}
return $result;
}
This will return the correct array/value:
Array
(
[0] => value
)
But what if I want to delete this value (like unset($array[1][1])) from the original array and return the original $array without the value?