📜  php 按属性从数组中删除对象 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:55.874000             🧑  作者: Mango

代码示例1
$new_array = [];
foreach ($myarray as $key => $value) {
    if ($value->catid == 29) {
        $new_array[] = $value;
        unset($myarray[$key]);        
    }
}