批量处理文章内容

 
更多

<?php
require_once (dirname ( __FILE__ ) . "./include/common.inc.php");
$dsql = "select aid,body from hk_addonarticle";
$db->Execute ( 'me', $dsql );
$Result=array();
while ( $arr = $db->GetArray () ) {
	$body=preg_replace("/onclick=('|\")?(.*)\\1/sU",'',$arr ['body']);
	$body=str_replace("style=\"cursor:pointer\" ","",$body);
	$sql ="update hk_addonarticle set body='{$body}' where aid ={$arr['aid']};";
	$rs = $db->ExecuteNoneQuery2($sql);
	$Result[$rs][]=$arr['aid'];
	//echo $arr['aid'] .'->'.$rs.'<hr/>';
}
foreach($Result as $key=>$Array){
if($key!="1"){
echo $key.'<hr/>';
  foreach($Array as $val){
      echo "<p>{$val}</p>";
  }
 }
}


?>

打赏

本文固定链接: https://www.cxy163.net/archives/937 | 绝缘体

该日志由 绝缘体.. 于 2013年08月07日 发表在 首页 分类下,
原创文章转载请注明: 批量处理文章内容 | 绝缘体
【上一篇】
【下一篇】

报歉!评论已关闭.