帝国CMS图集PHP调用代码及调用图集第一张图片
<!--调用图片集第一张图-->
<?php
$str=$navinfor[morepic];
$exp=explode("\\r\\n",$str);
$exp1=explode("::::::",$exp[0]);
?>
<img src="<?=$exp1[1]?>" width="660" height="560" alt="<?=$exp1[2]?>" />
<!--调用图片集大图-->
<?php
if($navinfor[morepic])
{
$exp=explode(chr(13),$navinfor[morepic]);
if($exp)
{
?>
<?php
foreach($exp as $k=>$v)
{
$exp2=explode('::::::',$v);
if($exp2[1])
{
echo '<img src="'.$exp2[1].'" width="660" height="560">';
}
}
}
}
?>
<!--调用图片集小图-->
<?php
if($navinfor[morepic])
{
$exp=explode(chr(13),$navinfor[morepic]);
if($exp)
{
?>
<?php
foreach($exp as $k=>$v)
{
$exp2=explode('::::::',$v);
if($exp2[0])
{
echo '<img src="'.$exp2[0].'" width="60" height="50">';
}
}
}
}
?>
下面的方法比较好用
图片集调用代码:
<?php $picr=explode(egetzy('rn'),$navinfor[morepic]); for($p=0;$p<count($picr);$p++) { $spicr=explode("::::::",$picr[$p]); ?> 小图地址:<img src="<?=$spicr[0]?>" /> 大图地址:<img src="<?=$spicr[1]?>" /> 图片名称:<?=$spicr[2]?> <?php } ?> 输出的代码: <img src="/d/file/sell/2014-07-02/154f3b8dd3c1d6d569d886ad0c6f2800.jpg" /> <img src="/d/file/sell/2014-07-02/5472a488663bf1af5802948b626dac46.jpg" /> <img src="/d/file/sell/2014-07-02/b61ea31ea9f1de3330a79d442b8b59b1.jpg" /> <img src="/d/file/sell/2014-07-02/b29de812f7e01cb75fa0dfefa1bd3502.jpg" /> 调用图集中第一张图片: <?php $str=$navinfor[morepic]; $exp=explode("::::::",$str); ?> <img src="<?=$exp[1];?>" alt="第一张" /> <?php ?>

浙公网安备 33010602011771号