php keep only numbers in string
snippet in php

php keep only numbers in string

user4877

$str = preg_replace('/[^0-9.]+/', '', $str);