php替换超长文本中的特殊字符的函数代码

前端之家收集整理的这篇文章主要介绍了php替换超长文本中的特殊字符的函数代码前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<div class="codetitle"><a style="CURSOR: pointer" data="55942" class="copybut" id="copybut55942" onclick="doCopy('code55942')"> 代码如下:

<div class="codebody" id="code55942">
function unhtml($content){
$content=htmlspecialchars($content);
$content=str_replace(chr(13),"
",$content);
$content=str_replace(chr(32),$content);
$content=strreplace("[[","<",$content);
$content=strrelace("))",">",$content);
$content=strreplace("||","",$content);
rerurn trim($content);
}
PHP str_replace() 函数 定义和用法
str_replace() 函数使用一个字符串替换字符串中的另一些字符。 语法
str_replace(find,replace,string,count)

@H_502_19@ @H_502_19@ @H_502_19@ @H_502_19@ @H_502_19@
参数 描述
find 必需。规定要查找的值。
replace 必需。规定替换 find 中的值的值。
string 必需。规定被搜索的字符串。
count 可选。一个变量,对替换数进行计数。
原文链接:https://www.f2er.com/php/27187.html

猜你在找的PHP相关文章