最新更新 sitemap 网站制作设计本站搜索
网页设计
国外网站 韩国网站 个人主页 手提袋设计 CSS 网页特效 平面设计 网站设计 Flash CMS技巧 服装网站 php教程 photoshop 画册 服务器选用 数据库 Office
虚拟主机 域名注册 云主机 网页设计 客服QQ:8208442
当前位置:首页 > 编程开发 > asp教程

ASP开发中几个实现与PHP相同功能的同名函数

日期:03-29    来源:中国设计秀    作者:cnwebshow.com

<%    O96中国设计秀
function htmlspecialchars(someString)    O96中国设计秀
htmlspecialchars = replace(replace(replace(replace(someString, "&amp;", "&"), ">", ">"), "<", "<"), """", """)    O96中国设计秀
end function    O96中国设计秀
   O96中国设计秀
function htmlspecialchars_decode(someString)    O96中国设计秀
htmlspecialchars_decode = replace(replace(replace(replace(someString, "&", "&amp;"), ">", ">"), "<", "<"), """, """")    O96中国设计秀
end function    O96中国设计秀
   O96中国设计秀
sub echo(someText)    O96中国设计秀
        Response.Write Replace(someText, "n", vbCrLf)    O96中国设计秀
end sub    O96中国设计秀
   O96中国设计秀
function nl2br(someText)    O96中国设计秀
        nl2br = Replace(someText, vbCrLf, "<br />")    O96中国设计秀
end function    O96中国设计秀
   O96中国设计秀
Function wordwrap(str,width,breakString)    O96中国设计秀
 Dim words    O96中国设计秀
 Dim out, temp     O96中国设计秀
 Dim i,k    O96中国设计秀
 out = ""   O96中国设计秀
 words = Split(str," ")    O96中国设计秀
 For i = 0 To UBound(words)    O96中国设计秀
  If Len(words(i)) >= width Then   O96中国设计秀
   temp = ""   O96中国设计秀
   parola = words(i)    O96中国设计秀
   For k = 1 To Len(parola)    O96中国设计秀
    temp = Left(parola,k)    O96中国设计秀
    If len(temp)>=width Then   O96中国设计秀
     out = out & temp & breakString    O96中国设计秀
     parola = Right(parola,Len(parola) - width)    O96中国设计秀
     k = 1    O96中国设计秀
     temp = ""   O96中国设计秀
    End if    O96中国设计秀
   Next   O96中国设计秀
   out = out & temp & breakString    O96中国设计秀
  Else   O96中国设计秀
   out = out & words(i) & breakString    O96中国设计秀
  End If   O96中国设计秀
 Next   O96中国设计秀
 wordwrap = Trim(out)    O96中国设计秀
End Function   O96中国设计秀
%>O96中国设计秀

本文引用地址:/bc/article_46295.html
网站地图 | 关于我们 | 联系我们 | 网站建设 | 广告服务 | 版权声明 | 免责声明