asp 去除html的函式,要保留段落,換行和空格

2021-05-25 06:01:45 字數 562 閱讀 3605

function htmlencode(fstring)

if not isnull(fstring) then

fstring = replace(fstring, ">", ">")

fstring = replace(fstring, "<", "<")

fstring = replace(fstring, chr(32), " ")

fstring = replace(fstring, chr(9), " ")

fstring = replace(fstring, chr(34), """)

fstring = replace(fstring, chr(39), "'")

fstring = replace(fstring, chr(13), "")

fstring = replace(fstring, chr(10) & chr(10), "

")fstring = replace(fstring, chr(10), "

")htmlencode = fstring

end if

end function

Asp過濾指定html標籤函式

過濾指定html標籤 function lfilterbadhtml byval strhtml,byval strtags dim objregexp,stroutput dim arrtag,i arrtag split strtags,set objregexp new regexp stro...

用php自帶函式去除html標記

strip tags 去掉 html 及 php 的標記。語法 string strip tags string str 傳回值 字串 函式種類 資料處理 內容說明 本函式可去掉字串中包含的任何 html 及 php 的標記字串。若是字串的 html 及 php 標籤原來就有錯,例如少了大於的符號,...

用php自帶函式去除html標記

strip tags 去掉 html 及 php 的標記。語法 string strip tags string str 傳回值 字串 函式種類 資料處理 內容說明 本函式可去掉字串中包含的任何 html 及 php 的標記字串。若是字串的 html 及 php 標籤原來就有錯,例如少了大於的符號,...