当前位置: 代码迷 >> PHP >> 数结合并
  详细解决方案

数结合并

热度:403   发布时间:2013-09-06 10:17:17.0
数组合并
2个数组:

//数组a
array (
  'SU13080800340' => 
  array (
    0 => 'CVT121015001',
    1 => 'CVT121015002',
    2 => 'CVT121226001',
  ),
)
//数组b
array (
  'stock_no' => 'SU13080800340',
  'adress' => 'B',
  'arr_time' => '2013-08-14 09:00:00',
  'c_type' => 'P32E',
  'cust_no' => '310F61VA5A',
  'mount_total' => '3',
  'total' => '48',
  'c1_time' => '2013-08-10 15:00:00',
)


求达到合并的效果:

array (
'0' =>
array (
  'stock_no' => 'SU13080800340',
  'adress' => 'B',
  'arr_time' => '2013-08-14 09:00:00',
  'c_type' => 'P32E',
  'cust_no' => '310F61VA5A',
  'mount_total' => '3',
  'total' => '48',
  'c1_time' => '2013-08-10 15:00:00',
  'packageno' => 'CVT121015001',
),
'1' =>
array (
  'stock_no' => 'SU13080800340',
  'adress' => 'B',
  'arr_time' => '2013-08-14 09:00:00',
  'c_type' => 'P32E',
  'cust_no' => '310F61VA5A',
  'mount_total' => '3',
  'total' => '48',
  'c1_time' => '2013-08-10 15:00:00',
  'packageno' => 'CVT121015002',
),
'2' =>
array (
  'stock_no' => 'SU13080800340',
  'adress' => 'B',
  'arr_time' => '2013-08-14 09:00:00',
  'c_type' => 'P32E',
  'cust_no' => '310F61VA5A',
  'mount_total' => '3',
  'total' => '48',
  'c1_time' => '2013-08-10 15:00:00',
  'packageno' => 'CVT121016001',
),
)
  相关解决方案