比較したい2つのアレイがあり、違いを収集します。
各配列に2つの要素のみを表示しています。通常、各配列には80000を超える要素が含まれます
Array1出力($Memcooltransactions
)
Array (
[0] => Array ( [zipcode] => 0000 [city] => 23593 Vellinge, Sverige [numberofuniqmembers] => 11 [numberofuniqspisesteder] => 0
[1] => Array ( [zipcode] => 4212 [city] => CPH, Denmark [numberofuniqmembers] => 2 [numberofuniqspisesteder] => 0 )
Array1出力($result
)
Array (
[0] => Array ( [zipcode] => 0460 [city] => Nordskali, Færøerne [numberofuniqmembers] => 1 [numberofuniqspisesteder] => 0
[1] => Array ( [zipcode] => 4212 [city] => CPH, Denmark [numberofuniqmembers] => 2 [numberofuniqspisesteder] => 0 )
必要な出力:
[0] => Array ( [zipcode] => 0000 [city] => 23593 Vellinge, Sverige [numberofuniqmembers] => 11 [numberofuniqspisesteder] => 0
[1] => Array ( [zipcode] => 0460 [city] => Nordskali, Færøerne [numberofuniqmembers] => 1 [numberofuniqspisesteder] => 0
これは私が試した方法です:
$result2 = array_diff_assoc($Memcooltransactions, $result1);
しかし、私はこの出力を取得しています:( $result2
)
Array (
[0] => Array ( [zipcode] => 0000 [city] => 23593 Vellinge, Sverige [numberofuniqmembers] => 11 [numberofuniqspisesteder] => 0
[1] => Array ( [zipcode] => 4212 [city] => CPH, Denmark [numberofuniqmembers] => 2 [numberofuniqspisesteder] => 0
[2] => Array ( [zipcode] => 0460 [city] => Nordskali, Færøerne [numberofuniqmembers] => 1 [numberofuniqspisesteder] => 0
)
なぜこうなった?