3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = 'In My Cart : 11 12 items'; preg_match_all('!\d+!', $str, $matches); $str = 'In My Cart : 11 items'; $int = filter_var($str, FILTER_SANITIZE_NUMBER_INT); print_r($int);
based on KcBlY
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
11