Good day, people, okay? I have the code that prints the different values found in 2 arrays and those values get stored in the different variable ($ different) I need to know how I can print these values stored in different but telling which array it belongs:
$a = [1,2,3,4,5];
$b = [2,4,6,7];
$diferentes = 1, 3, 5, 7
I need to print:
$a = 1,3,5
$b = 7
I tried to use array_diff
but failed.
$diff1 = array_diff($diferentes, $a);
$diff2 = array_diff($diferentes, $b);
Thank you in advance.