3v4l.org

run code in 300+ PHP versions simultaneously
<?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"; }

preferences:
43.91 ms | 402 KiB | 5 Q