php怎么去除字符?
如果沒有中文的話可以用 str_replace
str_replace(find,replace,string,count)
str_replace()
函數(shù)以其他字符替換字符串中的一些字符(區(qū)分大小寫)
參數(shù)
find 必需。規(guī)定要查找的值。
replace 必需。規(guī)定替換 find 中的值的值。
string 必需。規(guī)定被搜索的字符串。
count 可選。對替換數(shù)進(jìn)行計數(shù)的變量。
例:把字符串 "Hello world!" 中的字符 "world" 替換為 "Shanghai"
echo str_replace("world","Shanghai","Hello world!");
輸出結(jié)果:
Hello Shanghai!
推薦:《PHP教程》