当前位置:文章中心 - ASP编程 - ASP高亮关键字
相关文章
这里放搜索
最新文章
ASP高亮关键字
关键词:ASP,高亮,关键字 时间:2008年05月26日 星期一 阅读:229
程序代码
  1. <%        
  2. public function keywordlight(l1,l2)        
  3.     dim bads,I1,I2,I3,i        
  4.     if len(l1)>0 and len(l2)>0 then        
  5.         I1=l1        
  6.         I2=split(l2,",")        
  7.             set I3=new regexp        
  8.                 I3.global=true        
  9.                 I3.ignorecase=true        
  10.                 for i=0 to ubound(I2)        
  11.                     if len(trim(I2(i)))>0 then        
  12.                         I3.pattern="("&I2(i)")"       
  13.                         I1=I3.replace(I1,"<font color=red>$1</font>")        
  14.                     end if        
  15.                 next        
  16.                 keywordlight=I1        
  17.             set I3=nothing        
  18.     end if        
  19. end function        
  20.        
  21. Response.Write keywordlight("蓝雨设计","雨,计")        
  22. %>  
上一篇:FSO获取文件大小下一篇:获取所有图片地址并隔开

0条记录访客评论

暂未有任何评论,你来发表一篇吧!

发表评论

(必填)
(必填)
 
友情链接