- array_intersect: documentation ( source)
<?php
$plotsOpenSpace2 = '111 222 333';
$plotsShell2 = '555 222 444';
$plotsOther2 = '000 999 666';
$entries = array($plotsOpenSpace2, $plotsShell2, $plotsOther2);
$test = array(111, 222, 465, 555, 666, 777);
foreach ($entries as $key => $entry) {
$matches = array_intersect($test, $entry);
if (count($matches) > 0) {
$i ++;
echo 'test';
}
}
?>