php怎么去除字符-PHP问题

资源魔 14 0

php怎样去除了字符?

假如不中文的话能够用 str_replace

str_replace(find,replace,string,count)

str_replace() 函数以其余字符交换字符串中的一些字符(区别巨细写)

参数

find 必须。规则要查找的值。

replace 必须。规则交换 find 中的值的值。

string 必须。规则被搜寻的字符串。

count 可选。对交换数进行计数的变量。

例:把字符串 "Hello world!" 中的字符 "world" 交换为 "Shanghai"

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

输入后果:

Hello Shanghai!

保举:《PHP教程》

以上就是php怎样去除了字符的具体内容,更多请存眷资源魔其它相干文章!

标签: php php教程 php故障解决 php使用问题

抱歉,评论功能暂时关闭!