时间:2021-07-01 10:21:17 帮助过:1人阅读
foreach($arr as $k => $v )
{
if($v>10)
删除arr[$k]
}
就是把键和值都移除..
foreach($arr as $k => $v )
{
if($v>10)
删除arr[$k]
}
$arr = [
'test' => 'test',
'test1' => 'test1'
];
unset($arr['test'])
print_r($arr);
#####
输出
[
'test1' => 'test1'
]