As i am new to regular expression i want to fetch exact number from string.I here paste code that i tried please tell me solution.In below code i can fetched number 4000 and 1 but i want only 4000 not 1 which is with 'a'
$str = "4000+a1";
preg_match_all('/[0-9]+/', $str, $matches);
return $matches;