易仿帝国yfdiguo.com

您当前的位置:首页 > 问题库

帝国CMS 7.0多值字段调用方法

zcmcss发表于2017-12-11问题库
完整调用方法:

<?php
  $dianping=$navinfor['dianping'];
  $mpr=explode('||||||',$dianping);
  $mpcount=count($mpr);
  for($mpi=0;$mpi<$mpcount;$mpi++)
  {
  $mp=explode('::::::',$mpr[$mpi]);            
  echo"<p>[".$mp[0]."月份] ".$mp[1]."</p>";
  }
?>

内容模板用php分割$navinfor[字段名]内容

示例1:


<?php
$morefr=explode('||||||',$navinfor[字段名]);
$mfcount=count($morefr);
for($mfi=0;$mfi<$mfcount;$mfi++)
{
?>
<?=$morefr[$mfi]?>
<?php
}
?>

示例2:

<?php
$test=explode("||||||",$navinfor['ziduan']);
?>
<?=$test[0]?>
<?=$test[1]?>
<?=$test[2]?>

热门问题

©2017 易仿帝国yfdiguo.com


友情链接: 阿里云优惠网| 阿里云推荐码| 阿里云教程| 莫愁博客|
♥ www.yfdiguo.com
联系作者QQ: