根据多维数组的内部值删除重复项

时间:2016-11-21 11:00:22

标签: php arrays

我在 PHP 中有三个数组。阵列的示例结构如下所示。我想检查id是否存在于第一个然后值,因为它不应该在任何其他数组中重复。例如,在id为200的记录下面的数组中存在于第一个数组中,然后它再次位于第三个数组中,因此我想要删除 来自第三个阵列的 c0 将有9个这样的数组。什么是动态的方式。

Array
(
    [a0] => Array
        (
             [id] => 100
             [Country] => some country
        )

    [a1] => Array
        (
            [id] => 200
            [Country] => some country

        )

)



Array
(
    [b0] => Array
        (
            [id] =>300
            [Country] => some country

        )

    [b1] => Array
        (
            [id] => 100
            [Country] => some country
            [city] => some city

        )

)



Array
(
    [c0] => Array
        (
            [id] =>200
            [Country] => some country
            [state] => some state

        )

    [c1] => Array
        (
            [id] => 400
            [Country] => some country

        )

)

0 个答案:

没有答案