开发者

Regular expression for preg_replace

开发者 https://www.devze.com 2023-02-25 04:50 出处:网络
Can you help me please开发者_JAVA百科 what is the regular expression for this string change in 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

精彩评论

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