3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $entries = array( array("exoutdoorspaceplottotals" => "111 222 465"), array("exoutdoorspaceplottotals" => "666 123 412"), array("exoutdoorspaceplottotals" => "000 999"), ); $test = array(111, 465, 555, 666, 777); $counter = 0; while ($row = array_shift($entries)) { $plotsTotal1 = explode(' ', $row['exoutdoorspaceplottotals']); $plotsTotal2 = array_filter($plotsTotal1); $matches = array_intersect($test, $plotsTotal2); if (count($matches) > 0) { echo 'Entry ' . $counter++ . ' contains ' . implode(',', $matches) . "\n"; } }
Output for 4.3.0 - 7.1.0
Entry 0 contains 111,465 Entry 1 contains 666