Smarty PHP Multidimensional Array loops
The structure of the array passed from PHP.
Array
(
[0] = = Array
(
[0] = = Array
(
[id] = 15
[PID] = 0-2-11
[Name] + women's Clothing
[HREF] =
[Date] = =
)
[1] = = Array
(
[id] = 18
[PID] = 0-2-11
[Name] + shirt
[HREF] =
[Date] = =
)
[2] = = Array
(
[id] = 40
[PID] = 0-2-11
[Name] = www
[HREF] =
[Date] = =
)
[3] = = Array
(
[id] = 45
[PID] = 0-2-11
[Name] = Fee Republic
[HREF] =
[Date] = =
)
)
[1] = = Array
(
)
[2] = = Array
(
[0] = = Array
(
[id] = 43
[PID] = 0-2-13
[Name] and, uh, uh,
[HREF] =
[Date] = =
)
)
[3] = = Array
(
)
[4] = = Array
(
)
[5] = = Array
(
)
[6] = = Array
(
)
[7] = = Array
(
[0] = = Array
(
[id] = 41
[PID] = 0-3-16
[Name] = Woo Hoo
[HREF] =
[Date] = =
)
)
[8] = = Array
(
[0] = = Array
(
[id] = 44
[PID] = 0-3-21
[Name] = Aston
[HREF] =
[Date] = =
)
)
[9] = = Array
(
)
[Ten] + = Array
(
)
[one] = = Array
(
)
[+] = Array
(
[0] = = Array
(
[id] = 42
[PID] = 0-9-38
[Name] + high-handed Hall
[HREF] =
[Date] = =
)
)
)
Reply to discussion (solution)
Smarty foreach
Smarty foreach
I know that, but the three-dimensional array won't get it!
To the effect of this
To the effect of this
{foreach Item=lop key=k name=loop from= $dao}
{$dao [$k].name} {foreach Item=lop2 key=kk name=loop1 from= $dao 1} {if $k = = $kk && $dao 1[$kk]| @count neq 0}
{foreach item=lop3 key=kkk from= $lop 2}
- {$lop 3.name} {foreach Item=lop4 key=kkkk from= $dao 2} {if $dao 2[$kkk]| @count NEQ 0} {foreach item=lop5 name=app key=kkkkk from= $lop 4} {if $lop 5.pid=== $lop 3.pid|cat: "-" |cat: $lop 3.id} {if $smarty. foreach.app.index==0}
{/if}
- {$lop 5.name}
{if $smarty. foreach.app.iteration== $lop 4| @count}
{/if} {/if} {/foreach} {/if} {/foreach} {/foreach}
{/if} {/foreach}{/foreach}