开发者

How do I split this word using PHP?

开发者 https://www.devze.com 2023-02-06 02:13 出处:网络
There are many words like this..... ma开发者_JAVA技巧thewthomas256 alexcannon5623 kohlanjame9568 nancycherikom257

There are many words like this.....

ma开发者_JAVA技巧thewthomas256
alexcannon5623
kohlanjame9568
nancycherikom257

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


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

The regex is "all digits (\d+) at the end of the line ($)". This works in a line-based manner because of the m modifier and globally over all lines because of the g modifier.


$remove = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
$onlynames = str_replace($remove, "", "name here");


preg_replace("/\d/", "", input)

0

精彩评论

暂无评论...
验证码 换一张
取 消