如果字符串中没有中文可以使用str_replace()函数替换字符串。
语法格式:
str_replace(find,replace,string,count)
参数介绍:

实例:
把字符串 "Hello world!" 中的字符 "world" 替换为 "Shanghai"
echo str_replace("world","Shanghai","Hello world!");
如果字符串中没有中文可以使用str_replace()函数替换字符串。
语法格式:
str_replace(find,replace,string,count)
参数介绍:

实例:
把字符串 "Hello world!" 中的字符 "world" 替换为 "Shanghai"
echo str_replace("world","Shanghai","Hello world!");