[e:loop={0,1,3,1}]
<divclass="yxsp_list_lf">

<ahref="<?=$bqsr['titleurl']?>"target="_blank">
<?php
$fr=$empire->fetch1("selectnewstextfrom{$dbtbpre}ecms_news_data_{$bqr[stb]}whereid='$bqr[id]'");//SQL查询正文内容
$str=stripcslashes($fr['newstext']);//正文内容脱敏
preg_match_all('/<img.*?src="(.*?)".*?>/is',$str,$imgArr);//正则
$imgArr=array_unique($imgArr[1]);//数组去重复

?>
<imgsrc="<?=$imgArr[0]?>"alt="<?=$bqr['title']?>">
<spanclass="txt_bj"></span>
<spanclass="txt"><?=$bqr['title']?></span>
<!--<spanclass="video_icon"></span>-->
</a>
</div>
[/e:loop]

 

说明:

调用多张图片,例如3张的话,如下写法:

<?=$imgArr[0]?> <?=$imgArr[1]?> <?=$imgArr[2]?>

 

 

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。