Array
(
[15, BBC company] => Array
(
[147, IT Dep] => 85
[150, HR Dep] => Array
(
[58] => employee 1
[71] => employee 2
)
)
)
I would like to delete [58] => employee 1 from array The following is my code, however, it doesn't work.
Can anyone help me? Many thanks!
foreach($arr as $key=>$value){
foreach ($value as $subKey=>$subVal){
foreach($subVal as $k=>$v){
if($k==58){
echo $k;
unset($subVal[$k]);
}
}
}
}
Expected result
Array
(
[15, BBC company] => Array
(
[147, IT Dep] => 85
[150, HR Dep] => Array
(
[71] => employee 2
)
)
)