3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array("nl", "net", "com"); $domain = explode(".", '.ne'); foreach($a as $c) { echo (strlen($domain[1]) - 1); if($c[(strlen($domain[1]) - 1)] == $domain[1]) { $matches[]= $c; } } if(!empty($matches)) { echo implode(',', $matches); } else { echo 'no matches'; }
based on k1WDm
Output for 5.6.38 - 7.3.0rc3
111no matches