01-13-2017, 06:43 PM
I just realized that if your results don't work when you add more checkboxes, you can change the second set of logic from
to
Note that as you add your 3rd (and beyond) checkbox, use the second set of logic where you are saying if !in_array so you don't get duplicates in your array).
Code:
foreach ($comp as $c){
Code:
if (!in_array($c, $matches))
Code:
{
Code:
$matches[] = $c;
Code:
}
to
Code:
foreach ($comp as $c){
Code:
if (!in_array($c, $matches))
Code:
{
Code:
array_push($matches,$c);
Code:
}
Note that as you add your 3rd (and beyond) checkbox, use the second set of logic where you are saying if !in_array so you don't get duplicates in your array).