array("on", "11", "101", "1001"), "">
时间:2021-07-01 10:21:17 帮助过:21人阅读
$arr = array(
"net" => array("on", "11", "101", "1001"),
"login" => array("on", "10001","100001","1000001")
);
array_walk($arr, function(&$t) {
$t = array_diff($t, array('on'));
});
print_r($arr);
Array
(
[net] => Array
(
[1] => 11
[2] => 101
[3] => 1001
)
[login] => Array
(
[1] => 10001
[2] => 100001
[3] => 1000001
)
)
$arr = array(
"net" => array("on", "11", "101", "1001"),
"login" => array("on", "10001","100001","1000001")
);
$str ='';
foreach ($arr as $key=>$value){
foreach ($value as $k =>$v){
if($v != 'on') $str = $str
------解决思路----------------------
$v;
}
}
var_dump($str);
string(7) "1111111"
$arr = array("net" => array("on", "11", "101", "1001"),
"login" => array("on", "10001","100001","1000001"));
delon($arr);
print_r($arr);
function delon(&$arr){
foreach($arr as $key=>&$val){
foreach($val as $k=>$v){
if($v=='on'){
unset($val[$k]);
}
}
}
}