$mesg[$i] = eregi_replace("$mesg[$i]","[<a href=\"mailto:$mesg[$i]\">$mesg[$i]</a>]",$mesg[$i]);
解决方案 »
- #新手来袭# 关于mysqli和mysql函数插入数据出现乱码
- PHP画图可以在保存到文件中,但是在浏览器只是一个叉
- php,js的JSON应用,请帮忙找下错误,没实验对。。。
- PHPMailer 报错 Could not instantiate mail function.
- 用什么单元测试工具比较好?
- 又是session的问题,winxp+apache2.0.46+php4.3.2+mysql4.23.57
- 急救!在新用户注册中,当用户输入的内容含有“'”或“"”时,如何屏蔽或者如何给出错误提示?
- 感谢(犬犬(心帆),但问题还是没有解决,但已经揭贴了,再开贴(在线等待)
- 请问如何在打开页面时自动打开word文档??
- 文件上传的问题
- 如何得到我想要的date格式
- Ask
asp 版
必须http://开头,以空格或回车还行结束,如果出现,()将会出现错误的连接。
Function setLink(str)
'$ID:2002-6-24 10:10
'@Function: set string "http://" to link
'@Ver1.0
'@Author:[email protected]
setLink=str
setLink=replace(setLink,"HTTP://","http://")
setLink=replace(setLink," "," ")
setLink=replace(setLink,chr(13),"<br>")
setLink=replace(setLink,"<br>","<br>")
setLink=replace(setLink,"<BR>","<br>")
setLink=replace(setLink,"''",chr(39))
intDeal= instr(setLink,"http://")
if intDeal<=0 then
exit function
end if
'get first space after intDeal
args=split(setLink,"http")
buf=""
for i=0 to Ubound(args)
if (left(args(i),3)<>"://" ) then
buf=buf&args(i) 'store 偶数
else
linktmp=args(i)
strlink=linktmp
nbsp=""
intSpace=instr(linktmp," ")
intBr=instr(linktmp,"<br>")
if intSpace>intBr then intSpace=intBr
if intSpace>0 then
strlink=trim(left(linktmp,intSpace-1))
nbsp=mid(linktmp,intSpace)
end if
strlink="http"&strlink
strlink="<a href="""&strlink&""" target=_blank>"&strlink&"</a>" 
buf=buf&strlink 'store link
end if
next
setLink=buf
End Function
'$ID:2002-6-27 17:39
'@Function: set string "http://" to link
'@Ver1.1
'@Author:[email protected]
'Fix ']) '&FullSpace ,etc.
setLink=str
setLink=replace(setLink,"HTTP://","http://")
setLink=replace(setLink," "," ")
setLink=replace(setLink,chr(13),"<br>")
setLink=replace(setLink,"<br>","<br>")
setLink=replace(setLink,"<BR>","<br>")
setLink=replace(setLink,"''",chr(39))
intDeal= instr(setLink,"http://")
if intDeal<=0 then
exit function
end if
'get first space after intDeal
args=split(setLink,"http")
buf=""
for i=0 to Ubound(args)
if (left(args(i),3)<>"://" ) then
buf=buf&args(i) 'store 偶数
else
linktmp=args(i)
strlink=linktmp
nbsp=""
intSpace=instr(linktmp," ")
intBr=instr(linktmp,"<br>")
if intSpace>intBr then intSpace=intBr
intUnKnow=instr(linktmp,"。")
if intSpace>intUnKnow and intUnKnow<>0 then intSpace=intUnKnow
intUnKnow=instr(linktmp,")")
if intSpace>intUnKnow and intUnKnow<>0 then intSpace=intUnKnow
intUnKnow=instr(linktmp,",")
if intSpace>intUnKnow and intUnKnow<>0 then intSpace=intUnKnow
intUnKnow=instr(linktmp,"]")
if intSpace>intUnKnow and intUnKnow<>0 then intSpace=intUnKnow
intUnKnow=instr(linktmp," ") '中文半角空格
if intSpace>intUnKnow and intUnKnow<>0 then intSpace=intUnKnow
intUnKnow=instr(linktmp," ")'中文全角空格
if intSpace>intUnKnow and intUnKnow<>0 then intSpace=intUnKnow
intUnKnow=instr(linktmp,"(")
if intSpace>intUnKnow and intUnKnow<>0 then intSpace=intUnKnow
intUnKnow=instr(linktmp,")")
if intSpace>intUnKnow and intUnKnow<>0 then intSpace=intUnKnow
if intSpace>0 then
strlink=trim(left(linktmp,intSpace-1))
nbsp=mid(linktmp,intSpace)
end if
strlink="http"&strlink
strlink="<a href="""&strlink&""" target=_blank>"&strlink&"</a>" 
buf=buf&strlink 'store link
end if
next
setLink=buf
End Function