- array_intersect: documentation ( source)
- array_merge: documentation ( source)
- array_diff: documentation ( source)
<?php
$b = ['x' => 1, 'y' => 1];
$a = ['x' => 1, 'y' => 2];
if (count(array_diff(array_merge($a, $b), array_intersect($a, $b))) === 0) {
echo 'the same';
}