Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不知道如何对以下字符串使用 preg_replace 函数: ,$
这是我现在使用的:
$camp_ANS_STAT_SQL = preg_replace(",$", "", $camp_ANS_STAT_SQL);
我环顾四周并尝试使用反斜杠和正斜杠,但似乎找不到正确的组合。
任何帮助是极大的赞赏。谢谢你。
不需要正则表达式
$camp_ANS_STAT_SQL = str_replace(",$", "", $camp_ANS_STAT_SQL);
str_replace()