I have the following code portion to buy two fixes:
$a = array(
array('cuenta' => 1000),
array('cuenta' => 2000)
);
$b = array(
array('cuenta' => 1000),
array('cuenta' => 2000),
array('cuenta' => 3000)
);
print_r($a);
print_r($b);
$d = array_udiff($a, $b, function($x, $y) use ($a, $b){
if($x['cuenta'] == $y['cuenta']){
return 0;
}else{
return 1;
}
});
print_r($d);
When you ran the above shows me on the screen
// Arreglo $a
Array
(
[0] => Array
(
[cuenta] => 1000
)
[1] => Array
(
[cuenta] => 2000
)
)
// Arreglo $b
Array
(
[0] => Array
(
[cuenta] => 1000
)
[1] => Array
(
[cuenta] => 2000
)
[2] => Array
(
[cuenta] => 3000
)
)
// Arreglo $d
Array
(
)
What should I correct in my code or what should I do so that when I executed this code the result of the $d
fix is this:
Array
(
[0] => Array
(
[cuenta] => 3000
)
)