帝國CMS多值字段的調用,以及只調用多值字段最新增加的一行。
發布時間:2019-10-10 來源:未知 瀏覽: 關鍵詞:
多值字段調用如下:
<?php
$morefr=explode('||||||',$navinfor[字段名]);
$mfcount=count($morefr);
for($mfi=0;$mfi<$mfcount;$mfi++)
{
$morefrf=explode('::::::',$morefr[$mfi]);
?>
選項1:<?=$morefrf[0]?>
選項2:<?=$morefrf[1]?>
選項3:<?=$morefrf[2]?>
選項4:<?=$morefrf[3]?>
......
<?php
}
?>
多值字段如何只調用最后一行的數據(其實就是“直接調用數組-1 $morefr[count($morefr)-1]”)代碼如下:
<?php
$morefr=explode('||||||',$navinfor[字段名]);
$mfcount=count($morefr);
{
$morefrf=explode('::::::',$morefr[count($morefr)-1]);
?>
<ul>
<li><?=$morefrf[0]?><?=$morefrf[1]?><?=$morefrf[2]?></li>
</ul>
<?php
}
?>
責任編輯:實速科技