3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testString = "\\;\\3;4;5"; $digits = preg_replace("/[^0-9]/", "", $testString); $arr = str_split($digits,1); $string = implode(',',$arr); echo $string; ?>

preferences:
147.1 ms | 406 KiB | 5 Q