最新消息: 新版网站上线了!!!

php把html转换成文本text的函函

php把html转换成文本text的函函
function Text2Html($txt){
        $txt = str_replace("  "," ",$txt);
        $txt = str_replace("<","<",$txt);  
        $txt = str_replace(">",">",$txt);
$txt = str_replace(",","",$txt);
$txt = str_replace(",","",$txt);
$txt = str_replace("“","",$txt);
$txt = str_replace("”","",$txt);
 
 
        $txt = preg_replace("/[rn]{1,}/isU","
rn",$txt);
        return $txt;
}

转载请注明:谷谷点程序 » php把html转换成文本text的函函