原数组
Array ( [0] => Array ( [activity_id] => 2 [applyid] => 5 [name] => 王 [mobile] => 1366666666 [signed] => Array ( [0] => Array ( [id] => 1 [activityid] => 2 [activityname] => 测试数据2多次签到 [signedname] => 一次签到 [create_time] => 1465181547 [listorder] => 0 [sign_img] => [type] => [time] => ) [1] => Array ( [id] => 3 [activityid] => 2 [activityname] => 测试数据2多次签到 [signedname] => 二次签到 [create_time] => 1465182225 [listorder] => 0 [sign_img] => [type] => [time] => ) [2] => Array ( [id] => 4 [activityid] => 2 [activityname] => 测试数据2多次签到 [signedname] => 三次签到 [create_time] => 1465189536 [listorder] => 0 [sign_img] => [type] => [time] => ) [3] => Array ( [0] => 1463056434 [1] => 1 ) [4] => Array ( [0] => 1463074455 [1] => 3 ) ) ) [1] => Array ( [activity_id] => 2 [applyid] => 6 [name] => zhang [mobile] => [signed] => Array ( [0] => Array ( [id] => 1 [activityid] => 2 [activityname] => 测试数据2多次签到 [signedname] => 一次签到 [create_time] => 1465181547 [listorder] => 0 [sign_img] => [type] => [time] => ) [1] => Array ( [id] => 3 [activityid] => 2 [activityname] => 测试数据2多次签到 [signedname] => 二次签到 [create_time] => 1465182225 [listorder] => 0 [sign_img] => [type] => [time] => ) [2] => Array ( [id] => 4 [activityid] => 2 [activityname] => 测试数据2多次签到 [signedname] => 三次签到 [create_time] => 1465189536 [listorder] => 0 [sign_img] => [type] => [time] => ) [3] => Array ( [0] => 1463036123 [1] => 4 ) ) ) )
要把对应的time赋值到上面
for($i=0;$i<count($new_rst);$i++){
for($j=0;$j<count($new_rst[$i]['signed']);$j++){
for($k=0;$k<count($result);$k++){
if($new_rst[$i]['signed'][$j]['id']==$result[$k]['typeid'] && $new_rst[$i]['name']==$result[$k]['name']){
$new_rst[$i]['signed'][$j]['time']=$result[$k]['signedtime'];
break;
}
}
}
}