广告联盟网

 找回密码
 注册
12
返回列表 发新帖
楼主: 198010
打印 上一主题 下一主题

有什么办法清楚数据库中的HTML格式

[复制链接]
11#
发表于 2006-11-21 | 只看该作者
读出数据进行清除,再保存!
asp如何清除html代码
用正则表达式,我写一个VBScript函数给你。
<%
function clearHTMLCode(originCode)
dim reg
set reg = new RegExp
reg.Pattern = &quot;<[^>]*>&quot;
reg.Global = true
clearHTMLCode = reg.Replace(originCode, &quot;&quot;)
end fucntion
%>
12#
发表于 2006-11-21 | 只看该作者
楼上的是正确的。

set rs=conn.execute(&quot;select id,content form foosun_news&quot;)
do while not rs.eof
conn.execute(&quot;update foosun_news set content='&quot;&clearHTMLCode(rs(&quot;content&quot;))&&quot;' where id=&quot;&rs(&quot;id&quot;))
rs.movenext
loop

大概是这样的。再不会没有办法了。
13#
 楼主| 发表于 2006-11-22 | 只看该作者
谢谢楼上的先啊,我看看能否搞得掂,再来请教
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|广告联盟网  

GMT, 2024-6-7 , Processed in 0.113454 second(s), 17 queries .

Powered by Discuz! X3.2

© 2005-2021 www.ggads.com GGADS 广告联盟网

快速回复 返回顶部 返回列表