3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '1111-1112-3333-4444'; var_dump(substr(preg_replace('[^0-9+]/i', '', $string), 0, 6));

preferences:
54.7 ms | 402 KiB | 5 Q