转自https://blog.csdn.net/qq_40270754/article/details/87988423

感谢作者的无私分享!

控制器

//转为字符串
$label_array = implode(",", $change_one);


//将字符串转为索引数组
$arr = explode ( ',', $label_array );
$this->assign(array(
'arr' => $arr,
));
 

模板中

<ul>
{volist name="arr" >{$vo}</a>
{/volist}
</ul>
 

前台效果

thinkphp5 如何将带分隔符的字符串转换成索引数组,并且遍历到前台

 

 



相关文章:

  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-27
  • 2021-12-15
  • 2021-11-19
相关资源
相似解决方案