3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = " - 602,135 results "; Echo str_replace("-", "", filter_var($str, FILTER_SANITIZE_NUMBER_INT));

preferences:
27.14 ms | 405 KiB | 5 Q