标签:index set 方法 php ber end nbsp fun alt
方法1:
//去除值为"Cat"的元素
$a
=
array
(
"a"
=>
"Dog"
,
"b"
=>
"Cat"
,
"c"
=>
"Horse"
);
print_r(
$a
);
unset(
$a
[
array_search
(
"Cat"
,
$a
)]);
//array_search("Cat",$a)按元素值返回键名。去除后保持索引
print_r(
$a
);
foreach($productlist as $k=>$v){
if($v[‘id‘] == "204" || $v[‘id‘] == "207"){
unset($productlist[$k]);
}
}
标签:index set 方法 php ber end nbsp fun alt
原文地址:https://www.cnblogs.com/yszr/p/9045016.html