"123","2"=>"1234","3"=>"1334");$b=array("1"=>"123,"2"=>"1230");怎么得到$c=array("2"=>"12">
时间:2021-07-01 10:21:17 帮助过:18人阅读
$a = array("1"=>"123","2"=>"1234","3"=>"1334");
$b = array("1"=>"123","2"=>"1230");
$c = array();
foreach($a as $key=>$val){
if(isset($b[$key])){
if($val!=$b[$key]){
$c[$key] = $val>$b[$key]? $val : $b[$key];
}
}else{
$c[$key] = 'delete';
}
}
print_r($c);