Answer the question
In order to leave comments, you need to log in
Removing array elements. How to remove multiple keys?
The situation is this.
have an array
$options = array(
'749' => Array
(
'id' => 1,
'good' => 749,
'name' => 'test'
),
'800' => Array
(
'id' => 3,
'good' => 875,
'name' => 'test9'
),
'1090' => Array
(
'id' => 2,
'good' => 4222,
'name' => 'test6'
)
);
Answer the question
In order to leave comments, you need to log in
not quite clear Do you need to delete by ID or by keys?
judging by this, you still mean the keys of the $options array, if so then you can simply use:unset($options[749],$options[1090]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question