Answer the question
In order to leave comments, you need to log in
Why is the element not being removed from the array?
Hello! I want to remove an element from the array, but for some reason it is not removed.
My array:
$arr = [
'test' => ['users' => ['123']],
'test2' => ['users' => []]
];
unset($arr['test']['users'][array_search('123', $arr['test']['users'])]);
Answer the question
In order to leave comments, you need to log in
1. Try to write this in general:
$array = array('1st element', '2nd element', '3rd element');
unset($array[0]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question