大家好如果字符串语法如下,如何从字符串中获取数字(正数):t_def_type_id_2 t_def_type_22 t_def_type_334型所以,在第一个字符串中我想得到1,在第二个字符串中我想得到22,在第三个字符串中我想得到334,使用preg_match_all或任何其他可缝合的php函数 最佳答案 你可以用正则表达式\d+$ 用preg_match