3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = "NLD,13673, 978, 0, 0;DEU,461312, 21555, 450173, 7007;DNK,322948, 15824, 322948, 50701;SWE,319044, 16715, 17889, 0"; $string2 = "NLD,13673, 978, 0, 0"; if(strstr($string, ";") !== false){ $multipleMatches = explode(';' ,$string); $amountMatches = count($multipleMatches); for($i = 0; $i < $amountMatches; $i++){ echo $i; } } else { echo "Not found"; }
based on STjf2
Output for 4.3.0 - 7.2.0
0123