在两个不同的数组中查找值并将它们组合起来以保存在dtb中

时间:2017-10-12 08:32:04

标签: php arrays multidimensional-array

我有这两个嵌套数组:

第一个阵列:

Array ( 
    [0] => 200 
    [1] => OK. Created. 
    [2] => Array 
    ( [order] => 42c8dd9265f287693048353d6c95058f
        [shipments] => Array ( 
            [0] => IZ0716B9F2FA 
            [1] => IZ07FBD4F8E7 
            [2] => IZ075453B538 
            [3] => IZ07647393B4 
            [4] => IZ073EE209CB 
            [5] => IZ07CFFA8D8C 
            [6] => IZ0720BB9BB4 
        ) 
    ) 
) 

第二阵列:

 Array (
     [0] => CZK 
     [1] => invoice 
     [2] => Array( 
     [0] => Array ( 
        [reference] => 1710039172 
        [pickup_date] => 2017-12-12 
        [type] => regular 
        [from] => Array([id] => 53420 ) 
        [to] => Array([name] => [surname] => XXX 
            [company] => 
            [street] => XXX 
            [city] => XXX 
            [zip] => 27343 
            [country] => XX 
            [phone] => XXX 
            [email] => XXX ) 
        [packages] => Array( 
            [0] => Array( 
                [weight] => 1 
                [width] => 10 
                [height] => 20 
                [length] => 30 
                ) 
        ) ) 
    [1] => Array( 
    [reference] => 1710049181 
    [pickup_date] => 2017-12-12... etc.

数组中的项目顺序是相同的(我可以在第二个数组中将项目0解释为项目0)。

我需要将参考值与未发货的货物结合起来 - 我的目的是在数据库中将参考编号与货件编号存储在一行中。欢迎任何建议:)

0 个答案:

没有答案