$str 为一个带有数字的字符串。 $patterns = "/\d+/"; preg_match_all($patterns,$str,$arr); 把字符串传进preg_match 函数 就返回 所有数字的字符串】