How to delete specific value from multidimensional array in PHP

Is it possible to remove the specific value from multidimensional array in PHP ? If yes, what should I do to delete it ?
posted on 01.12.2020 at 16:38
0pnshow more
StorStor
Hi,

To delete the specific value from multidimensional array, you have to use the unset() function. The example can be:

$arr = array(100 => array(1000 => "aaa", 2000 => "bbb"));
print_r($arr);
unset($arr[100][2000]);
print_r($arr);

posted on 03.12.2020 at 10:19
0pnshow more
TimTim
share on facebookshare on twitter
2021 AnswerTabsTermsContact us