PHP多位数正则表达式
我需要使用正则表达式从以下字符串中提取数字:PHP多位数正则表达式,php,regex,preg-match,Php,Regex,Preg Match,我需要使用正则表达式从以下字符串中提取数字: /\d+/ pc 32444 xbox 43567 所以我的数组将是 数组([0]=>32444[1]=>43567) 有人能帮我安排一场预赛吗 谢谢 试试这个正则表达式: /\d+/ 但您需要使用preg\u match\u all获取所有匹配项: preg_match_all('/\\d+/', $str, $matches) $matches[0]将包含您要查找的数组
/\d+/
pc 32444 xbox 43567
所以我的数组将是
数组([0]=>32444[1]=>43567)
有人能帮我安排一场预赛吗
谢谢 试试这个正则表达式:
/\d+/
但您需要使用preg\u match\u all
获取所有匹配项:
preg_match_all('/\\d+/', $str, $matches)
$matches[0]
将包含您要查找的数组