0

有人可以帮我解决我的问题。该线程与我的问题非常接近,但我无法将其变为现实 不同大小的相交多维数组

我的第一个数组如下所示:

    Array
    (
    [0] => Array
        (
            [0] => 03320103000052
            [1] => 0
        )

    [1] => Array
        (
            [0] => 10013800805001
            [1] => 12
        )

    [2] => Array
        (
            [0] => 1090-0360141758201
            [1] => 3
        )
     etc.

第二个数组如下所示:

Array
(
    [0] => Array
        (
            [0] => 45
            [1] => 10640
            [2] => 1041-0567041700116
        )

    [1] => Array
        (
            [0] => 46
            [1] => 10640
            [2] => 1041-0567041700318
        )

    [2] => Array
        (
            [0] => 47
            [1] => 10640
            [2] => 1041-0567041700316
        ) ....
    [27] => Array
        (
            [0] => 207
            [1] => 10645
            [2] => 03320103000052
        ) etc.

从线程我试图使代码适应我的问题。但我排成一行。

if(isset($values[$v['id']])) {
                // Increase the amount of matches
                $values[$v['id']]++;

我需要从数组 2 中的数组 1 中找到匹配项。

输出匹配 14 正确但值不正确

输出如下所示:

Array ( [0] => 2 [1] => 2 [2] => 2 [3] => 2 [4] => 2 [5] => 2 [6] => 2 [7] => 2 [8] => 2 [9] => 2 [10] => 2 [11] => 2 [12] => 2 [13] => 2 )

非常感谢您的任何建议和帮助

4

0 回答 0