织梦采集没有自动生成摘要和关键字怎么办

//自动分析关键字和摘要  
preg_match("/<meta[\s]+name=[&#39;\"]keywords[&#39;\"] content=[&#39;\"](.*)[&#39;\"]/isU",$this->tmpHtml,$inarr);  
preg_match("/<meta[\s]+content=[&#39;\"](.*)[&#39;\"] name=[&#39;\"]keywords[&#39;\"]/isU",$this->tmpHtml,$inarr2);  
preg_match("/<meta[\s]+name=keywords content=[&#39;\"](.*)[&#39;\"]/isU",$this->tmpHtml,$inarr3);  
if(!isset($inarr[1]) && isset($inarr2[1]))  
{  
$inarr[1] = $inarr2[1];  
}  
if(!isset($inarr[1]) && isset($inarr3[1]))  
{  
$inarr[1] = $inarr3[1];  
}

 

posted @ 2024-08-22 12:26  黄文Rex  阅读(10)  评论(0)    收藏  举报