3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $mockedMysqlResult = 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($mockedMysqlResult)) { $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 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Entry 1 contains 111,465 Entry 2 contains 666