就是把键和值都移除..
<code>foreach($arr as $k => $v ) { if($v>10) 删除arr[$k] } </code>
就是把键和值都移除..
<code>foreach($arr as $k => $v ) { if($v>10) 删除arr[$k] } </code>
<code>$arr = [ 'test' => 'test', 'test1' => 'test1' ]; unset($arr['test']) print_r($arr); #####输出 [ 'test1' => 'test1' ]</code>