Return to Snippet

Revision: 64025
at June 28, 2013 00:52 by satie83

Initial Code
$str = 'In My Cart : 11 12 items';
preg_match_all('!\d+!', $str, $matches);

Initial URL

Initial Description
I want to extract the numbers from a string that contains numbers and letters like

Initial Title
PHP - Extract numbers from a string

Initial Tags
regex, php

Initial Language