<?php
function delete_items_by_ids(&$list, $ids) {
$arr = array_filter($list, function($val) use($ids){
return !in_array(intval($val['id']), $ids);
});
$list = array_values($arr);
}
$ids = [1];
$list = [['id'=> 1, 'name'=>'tom'], ['id'=> 2, 'name'=>'mike']];
delete_items_by_ids($list, $ids);
echo json_encode($list);
#输出:[{"id":2,"name":"mike"}]