我怎么能做到这一点?PHP如果字符串包含'+',请将其更改为'测试'?
我对str操作员很熟悉,但我很不确定我怎么能够做到这一点。
逻辑测试:
If (string.contains == '+') {
string.change("test");
}
基本上它需要什么:
it'll be used for a string that contains more then just a + e.g. hello+hello will change into -> hellotesthello
您应该提供一些例子,如'hello + hello'>'hellotesthello' –