Home >Backend Development >PHP Tutorial >PHP custom function to replace special characters in extremely long text_PHP tutorial

PHP custom function to replace special characters in extremely long text_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:51:10864browse

function  unhtml($content){
$content=htmlspecialchars($content);
$content=str_replace(chr(13),"
",$content);
$content=str_replace(chr(32),"
",$content);
$content=str_replace("[_[","<",$content);
$content=str_relace(")_)",">",$content);
$content=str_replace("|_|","",$content);
rerurn trim($content);

}
 

 

摘自 ms.元

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/478227.htmlTechArticlefunction unhtml($content){ $content=htmlspecialchars($content); $content=str_replace(chr(13),br,$content); $content=str_replace(chr(32),br,$content); $content=str_replace([_[,,$con...
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