3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $companyCad = array("52.10", "62", "64.15.44.25", "65.10", "65.14", "65.21", "70", "71", "71.15.12", "93.55"); $programCad = array("92.55", "92.74", "93", "94.10", "98.12", "98.66"); $match = array(); foreach($companyCad as $comp) { foreach($programCad as $prog) { if(strpos($comp, $prog) !== false) { $match[$comp] = $prog; break; } } } var_dump($match);
Output for 5.6.0 - 7.3.0rc3
array(1) { ["93.55"]=> string(2) "93" }