Lets suppose I have this array:
$doc = array(
'nfe' => array(
'inf' => array(
'det' => array(
'emit' => array(
'name' => 'My name'
)
)
)
)
)
and another array with the keys I want to unset (in order):
$keys = ['nfe', 'inf', 'det', 'emit']
How can I dynamically do this:
unset($doc['nfe']['inf']['det']['emit']);
Based on both arrays $doc
and $keys
?