"白"   1 => Array"/> "白"   1 => Array">
Home > Backend Development > PHP Tutorial > section循环数组的有关问题,

section循环数组的有关问题,

WBOY
Release: 2016-06-13 13:24:29
Original
1466 people have browsed it

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....

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template