php替换超长文本中的特殊字符的函数,主要就是通过str_replace实现字符的简单体会
代码如下:
function unhtml($content){
$content=htmlspecialchars($content);
$content=str_replace(chr(13),"
",$content);
$content=str_replace(chr(32),"
",$content);
$content=str_replace("[_[","$content=str_relace(")_)",">",$content);
$content=str_replace("|_|","",$content);
rerurn trim($content);
}
定义和用法
str_replace() 函数使用一个字符串替换字符串中的另一些字符。
语法
str_replace(find,replace,string,count)
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn