[PHP] 顯示 html 原始碼

function likepre ($string) {
$string = str_replace('"','"',$string);
$string = str_replace("'",''',$string);
$string = str_replace("<","&lt;",$string);
$string = str_replace(">","&gt;",$string);
$string = str_replace("\t"," ",$string);                //換為全角空格
$string = str_replace("  "," ",$string);                //兩個半角空格換為全角空格
$string = nl2br($string);
return $string;
}

From:笨笨林@PHPChina

[PHP] 顯示 html 原始碼 有 “ 1 則迴響 ”

發表迴響