输入banner图图片脚本导航/分类

php中的字符串替换函数是什么

如果字符串中没有中文可以使用str_replace()函数替换字符串。

语法格式:

str_replace(find,replace,string,count)

参数介绍:

bcdce2ebef5e19294a1b1cfed390595.png

实例:

把字符串 "Hello world!" 中的字符 "world" 替换为 "Shanghai"

echo str_replace("world","Shanghai","Hello world!");

更多相关教程请访问Gxlcms。

以上就是php中的字符串替换函数是什么的详细内容,更多请关注Gxlcms其它相关文章!