I have data from two different tables where the data have been implode after being selected from Checkboxes and they are divided by a ','. After i selected them from the database the two varibles could look like this.
$firstvar = Red, Blue, Green, Yellow
$secondvar = Green, Purple, White
So i want to know how i can check, if there is a match, when there is at least one of the colors that match in the two variables.
i've been trying with:
if (strpos($firstvar , $firstvar ) !== false) {
echo 'There is a match';
}
But it doesn't work.