3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function get_numerics ($str) { $matches = array(); preg_match("/\[([^]]*)\]/", $str, $matches); $matches = preg_replace("/[^0-9]/", '', $str); return ($matches); } $one = 'SP1-SP200'; print_r(get_numerics($one));
based on tFmC0
Output for 5.5.0 - 7.3.0rc3
1200