<?php
$pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";
$content = $article->Content; //文章内容
preg_match_all($pattern,$content,$matchContent);
if(isset($matchContent[1][0])){
$temp=$matchContent[1][0];
}else{
$temp="./images/no-image.jpg"; //在相应位置放置一张命名为no-image的jpg图片
}
?>