我想合并具有相同第一个元素q_id的数组

时间:2018-01-20 18:53:47

标签: php arrays multidimensional-array

Array
(
[0] => Array
    (
        [q_id] => 2
        [c_id] => 3
        [tot_amt] => 1200
        [tot_discount] => 0
        [tot_tax] => 156
        [grand_tot] => 1356
        [installdate] => 2017-11-09 00:00:00
        [referred] => SMITH
        [ordertag] => DF4
        [memo] => SOME TEXT
        [representative] => RAVIS
        [user] => akbar
        [dated] => 2017-12-01 12:57:43
        [order_status] => 0
        [active] => 1
        [qd_id] => 1
        [roomlocation] => BED ROOM
        [product] => blinds
        [style] => narrow
        [colour] => blue
        [width] => 46
        [height] => 50
        [qty] => 2
        [measurement] => Finish
        [side] => Left
        [cord] => 123
        [location] => Ceiling
        [valance] => Yes
        [valancetype] => Fascia
        [valancecolour] => BLUE
        [bottomrail] => Wrapped
        [disamt] => 80
        [subtot] => 813.6
        [taxamt] => 93.6
        [amount] => 800
        [customer_name] => john  phool
        [address] => address 
        [city] => kjbk
        [zip] => 8787yu
        [contact1] => 0987654321
        [contact2] => 087654321
        [email] => john@kjbk.comm
    )

[1] => Array
    (
        [q_id] => 2
        [c_id] => 3
        [tot_amt] => 1200
        [tot_discount] => 0
        [tot_tax] => 156
        [grand_tot] => 1356
        [installdate] => 2017-11-09 00:00:00
        [referred] => SMITH
        [ordertag] => DF4
        [memo] => SOME TEXT
        [representative] => RAVIS
        [user] => akbar
        [dated] => 2017-12-01 12:57:43
        [order_status] => 0
        [active] => 1
        [qd_id] => 2
        [roomlocation] => KITCHEN
        [product] => blinds
        [style] => narrow
        [colour] => blue
        [width] => 46
        [height] => 50
        [qty] => 1
        [measurement] => Tight
        [side] => Left
        [cord] => 123
        [location] => face of Wall 
        [valance] => Yes
        [valancetype] => Cassette
        [valancecolour] => GREEN
        [bottomrail] => Regular
        [disamt] => 40
        [subtot] => 406.8
        [taxamt] => 46.8
        [amount] => 400
        [customer_name] => john  phool
        [address] => address 
        [city] => kjbk
        [zip] => 8787yu
        [contact1] => 0987654321
        [contact2] => 087654321
        [email] => john@kjbk.comm
    )

[2] => Array
    (
        [q_id] => 3
        [c_id] => 3
        [tot_amt] => 740
        [tot_discount] => 0
        [tot_tax] => 96.2
        [grand_tot] => 836.2
        [installdate] => 2018-01-20 00:00:00
        [referred] => asd
        [ordertag] => john
        [memo] => asdasd
        [representative] => asd
        [user] => akbar
        [dated] => 2017-12-01 12:57:43
        [order_status] => 0
        [active] => 1
        [qd_id] => 3
        [roomlocation] => kitche 2
        [product] => Honeycomb/Cellular Shades
        [style] => Textured
        [colour] => BLUE 1
        [width] => 34
        [height] => 46
        [qty] => 1
        [measurement] => Tight
        [side] => Left
        [cord] => 12
        [location] => Ceiling
        [valance] => Yes
        [valancetype] => Cassette
        [valancecolour] => sdfw
        [bottomrail] => Wrapped
        [disamt] => 0
        [subtot] => 836.2
        [taxamt] => 96.2
        [amount] => 740
        [customer_name] => john  phool
        [address] => address 
        [city] => kjbk
        [zip] => 8787yu
        [contact1] => 0987654321
        [contact2] => 087654321
        [email] => john@kjbk.comm
    )

0 个答案:

没有答案