php代码
$arr = [ ['id' => 1], ['id' => 2], ['id' => 3], ['id' => 4], ]; $arr = array_filter($arr,function($var){ if($var['id'] %2 ==0){ return true; } return false; }); echo '<pre class="brush:php;toolbar:false">'; print_r($arr); result: Array ( [1] => Array ( [id] => 2 ) [3] => Array ( [id] => 4 ) )