开发者

Regular expression for preg_replace

Can you help me please开发者_JAVA百科 what is the regular expression for this string change in preg_replace?

from "On the day, he is playing" to "he is good to play".


preg_replace("/On the day, he is playing/", "he is good to play", $input);


If you want to replace anything coming after the last comma "," in a string, try this:

preg_replace("/[^,]*$/", " he is good to play", $input, 1);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜