if($arcRow['litpic']!=""){ $dsql->ExecuteNoneQuery("Delete From uploads where url='$arcRow[litpic]'"); $truedir = GetTruePath($arcRow['siterefer'],$arcRow['sitepath']); $litpicfile = $truedir.$arcRow['litpic']; @unlink($litpicfile); } |
$arcbodyQuery = "Select * from ".$arcRow['addtable']." where aid='$aid'"; $arcbodyRow = $dsql->GetOne($arcbodyQuery); $imgsrcarray=GetImageSrc($arcbodyRow['body']); foreach ($imgsrcarray as $v) { if((trim($v)!="")&&(!eregi("^http://",$v))){ $dsql->ExecuteNoneQuery("Delete From uploads where url='$v'"); $picfile = $truedir.$v; @unlink($picfile); } } |
function GetImageSrc($body){ if( !isset($body)) return ''; else{ preg_match_all ("/<(img|IMG)(.*)(src|SRC)=["|'|]{0,}([h|/].*(jpg|JPG|gif|GIF))["|'|s]{0,}/isU",$body,$out); return $out[4]; } } |
版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!