QQ咨询不加好友发不了信息,咨询前先加好友! → QQ:820896380 ×

帝国cms灵动标签调用正文三张图片,可设定调用数量。

[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]?>

给TA打赏
共{{data.count}}人
人已打赏
帝国CMS教程

帝国cms全站高效率随机调用函数代码(毫秒级调用)

2025-10-8 0:03:44

WEB前端

JS的Document属性和方法

2024-5-19 7:50:08

个人中心
购物车
优惠劵
有新私信 私信列表
搜索