- var_dump: documentation ( source)
<?php
$x = [
'a',
'b',
];
$y = [
'a',
'c',
];
$z = [
];
foreach ($x as $xval) {
foreach($y as $yval) {
if ($xval === $yval) {
continue 2;
}
}
$z[] = [$xval, $yval];
}
var_dump($z);