$res = array(); // 在外部定义$res
array_walk($data, function (&$v) use ($param, &$res) {
$v = json_decode($v, true);
if ( $v['appointment_date'] == $param['dateline'] ){
$res['venue_nameinfo_id'] = $v['venue_nameinfo_id'];
$res['appointment_date'] = $v['appointment_date'];
$res['start_time'] = $v['start_time'];
$res['end_time'] = $v['end_time'];
$res['venueinfo_type'] = $v['venueinfo_type'];
$res['venue_nameinfo_title'] = $v['venue_nameinfo_title'];
$res['venue_nameinfo_multiplayer'] = $v['venue_nameinfo_multiplayer'];
}
});
var_dump($res);
打印出来的结果是:
array(0) {
}
逻辑问题自行分析,
这个你只能在里面打印
array(2) {
["xxxxxx"]=>
int(123)
["xxx123"]=>
int(123)
}
$v['appointment_date'] == $param['dateline'] 会不会是你这个条件问题,根本没进去。