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 ?
01 Dec 2020 at 04:38 PM
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);

03 Dec 2020 at 10:19 AM
0pnshow more
TimTim
Share on FacebookShare on TwitterShare on LinkedInSend email
Follow us on Facebook & Twitter
2021 AnswerTabsTermsContact us