【发布时间】:2015-06-07 08:40:14
【问题描述】:
我正在尝试使用preg_replace 替换字符串中的单词或单词序列?
例如:
改变这些:
ABCExample to abcExample
AnotherExample to anotherExample
XyzAbcExample to xyzAbcExample
保持原样:
xyzExample to xyzExample
new to new
【问题讨论】:
-
我正在尝试在哪里?我没有看到任何尝试
-
为什么不用explode?span>
-
这里的问题是什么?该功能有据可查,并带有清晰的示例。当事情没有按预期工作时,您确实阅读了文档,不是吗? php.net/manual/en/function.preg-replace.php
标签: php regex string replace preg-replace