时间:2021-07-01 10:21:17 帮助过:3人阅读
array (
0 =>
array (
'cust_no' => '237109S92B',
'hi_no' => 'MEC38-431',
'arr_time' => '30/03/2014 9:00',
'totals' => 15,
'ch_date' => '26/03/2014 0:00',
'snp' => 15,
'mount' => 1,
'c_type' => 'D22',
),
1 =>
array (
'cust_no' => '237109S92B',
'hi_no' => 'MEC38-431',
'arr_time' => '30/03/2014 9:00',
'totals' => 15,
'ch_date' => '26/03/2014 0:00',
'snp' => 15,
'mount' => 1,
'c_type' => 'D22',
),
2 =>
array (
'cust_no' => '237033AW0A',
'hi_no' => 'BEM330-500',
'arr_time' => '30/03/2014 19:00',
'totals' => 15,
'ch_date' => '26/03/2014 0:00',
'snp' => 15,
'mount' => 1,
'c_type' => 'X11M',
),
3 =>
array (
'cust_no' => '237033AW0A',
'hi_no' => 'BEM330-500',
'arr_time' => '30/03/2014 19:00',
'totals' => 45,
'ch_date' => '26/03/2014 0:00',
'snp' => 15,
'mount' => 3,
'c_type' => 'X11M',
),
4 =>
array (
'cust_no' => '237033AW0A',
'hi_no' => 'BEM330-500',
'arr_time' => '30/03/2014 19:00',
'totals' => 45,
'ch_date' => '26/03/2014 0:00',
'snp' => 15,
'mount' => 3,
'c_type' => 'X11M',
),
5 =>
array (
'cust_no' => '237033AW0A',
'hi_no' => 'BEM330-500',
'arr_time' => '1/04/2014 19:00',
'totals' => 45,
'ch_date' => '26/03/2014 0:00',
'snp' => 15,
'mount' => 3,
'c_type' => 'X11M',
),
)
array (
0 =>
array (
'no'=> '2014-04-08_1',
'cust_no' => '237109S92B',
'hi_no' => 'MEC38-431',
'arr_time' => '30/03/2014 9:00',
'totals' => 15,
'ch_date' => '26/03/2014 0:00',
'snp' => 15,
'mount' => 1,
'c_type' => 'D22',
),
1 =>
array (
'no'=> '2014-04-08_1',
'cust_no' => '237109S92B',
'hi_no' => 'MEC38-431',
'arr_time' => '30/03/2014 9:00',
'totals' => 15,
'ch_date' => '26/03/2014 0:00',
'snp' => 15,
'mount' => 1,
'c_type' => 'D22',
),
)
$res = array();得
foreach($ar as $t) {
$k = join('_', array($t['arr_time'], $t['c_type'], $t['snp']));
$res[$k][] = $t;
}
print_r($res);
Array
(
[30/03/2014 9:00_D22_15] => Array
(
[0] => Array