3v4l.org

run code in 300+ PHP versions simultaneously
<?php preg_match_all('!\d+!', "lafkj 12 ksdhf -12 3 6 s 6", $matches); $string_of_numbers = implode(' ', $matches[0]); echo $string_of_numbers;

preferences:
41.47 ms | 402 KiB | 5 Q