龙岩易富通网络科技有限公司

龙岩小程序开发,龙岩分销系统

asp换行等字符转换html的函数

2015.09.10 | 355阅读 | 0条评论 | 未命名

[php] '----------Html转换为文本---------- Function Html2Text(Str1) If isNULL(Str1) Then Html2Text="" Exit Function End If Str1=Replace(Str1,"&lt;"," <") Str1=Replace(Str1,"&gt;",">") Str1=Replace(Str1," <br>",VBcrlf) Str1=Replace(Str1,"&quot;",chr(34)) Str1=Replace(Str1,"&nbsp;"," ") Str1=Replace(Str1,"&amp;","&") Html2Text=Str1 End Function [/php] '-------------------文本转换为Html---------- [php] Function Text2Html(Str1) If isNULL(Str1) Then Text2Html="" Exit Function End If Str1=Replace(Str1,"&","&amp;") Str1=Replace(Str1," <","&lt;") Str1=Replace(Str1,">","&gt;") Str1=Replace(Str1,VBcrlf," <br>") Str1=Replace(Str1,chr(34),"&quot;") Str1=Replace(Str1,chr(9),"&nbsp;&nbsp;&nbsp;") Str1=Replace(Str1," ","&nbsp;") Text2Html=Str1 End Function [/php]

赞 (

发表评论