"白"   1 => Array"/> "白"   1 => Array">

Home  >  Article  >  Backend Development  >  section循环数组的有关问题,

section循环数组的有关问题,

WBOY
WBOYOriginal
2016-06-13 13:24:291449browse

section循环数组的问题,大家来帮忙啊。
Smarty_Variable Object (3)
->value = Array (2)
  0 => Array (2)
  0 => "红"
  1 => "白"
  1 => Array (2)
  0 => "red"
  1 => "white"
->nocache = false
->scope = "Smarty root"

一般情况下,有键名的话,是这样循环的{$ProSortArr[ProSort].SortName}

现在上面这个数组,没有键名啊,只有0,1,2,3。。。这些,
怎么在section循环出来啊。可不可以像for 循环那样子,定义个i然后i++这样子啊。

------解决方案--------------------
{section name=i loop=$ar}
{$ar[i]}

{/section}
i 即为 索引,0,1,2,3....

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn