0

There are many words like this.....

mathewthomas256
alexcannon5623
kohlanjame9568
nancycherikom257

how do I remove numbers from above names using PHP? there are around 200k names like this

4

3 回答 3

3
preg_replace("/\d+$/gm", "", input)

正则表达式是“行尾的所有数字 ( \d+) ( $)”。由于修饰符,这以基于行的方式工作,并且由于m修饰符而在所有行上全局工作g

于 2011-01-21T00:56:36.837 回答
2
$remove = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
$onlynames = str_replace($remove, "", "name here");
于 2011-01-21T00:57:45.833 回答
0

preg_replace("/\d/", "", 输入)

于 2011-01-21T00:59:15.350 回答