<?
php$sql=$empire->query("select * from {$dbtbpre}ecms_news order by onclick desc limit 1");
while($r=$empire->fetch($sql)){
$text=GetTxtFieldText($r[newstext]); //获取正文内容
$text1=substr($text,12);//去除exit
$datanr=stripslashes($text1); //册除反
$pattern ="/.*src=\"([^^]*?)\".*/i"; //正则取图片
preg_match_all($pattern,$datanr,$matchess);
$
diypic=$matchess[1][0]; //取第一张图片地址
?>
<img src="<?=$diypic?>">
<?}?>