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);
精彩评论