Hello;
$a=array('red','green','yellow','blue'); $b=array('red','green');
I need to output yellow and blue.
I dont see any array functions that do that. Anyone have an approach on this, Thank you for anyone who helps.
[man]array_diff[/man] can do it.
array_diff will print what is in a that is not in b.
The problem is one array is one subarray of the other.
I need color red.
Hope the image helps. Thank you
Um, what's the question again? You want what's in a but not in b, so if you have (yellow, red, green, blue) and (red, green) you want (yellow, blue)?
But array_diff won't work because that gives you what's in a but not in b?!
Oops, I was referring to the color red from the image.
I would like the output of the array to be yellow and blue.