3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function getVehicleType($id, $types) { $types = explode(';', $types); foreach ($types as $key => $type) { $types[$key] = substr($type, 0, 1); if ($types[$key] == $id) return true; } } echo getVehicleType(1, '1 - teste;2 - teste;3 - teste;'); ?>
based on jSv45
Output for 4.3.0 - 7.2.0
1