I want to extract the digits from a string that contains numbers and letters like:
"In My Cart : 11 items"
I want to extract the nu
You can use preg_match:
$s = "In My Cart : 11 items"; preg_match("|\d+|", $s, $m); var_dump($m);