PHP Zachowaj tylko liczby w ciągu
$str = preg_replace('/[^0-9.]+/', '', $str);
Bad Batfish
$str = preg_replace('/[^0-9.]+/', '', $str);
$str = 'In My Cart : 11 items';
$int = (int) filter_var($str, FILTER_SANITIZE_NUMBER_INT);
$result = preg_replace("/[^a-zA-Z0-9]+/", "", $s);