|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Dros Smarty Rookie
Joined: 17 Dec 2003 Posts: 7
|
Posted: Tue Feb 01, 2005 12:51 pm Post subject: Howto loop through array(array(array())) in a section |
|
|
Hi,
I made the following array:
Array
(
[1] => Array
(
[0] => Array
(
[kapitel] => 0024005101
[hhtitel] => 51143-785
[kstelle] => FUB
[kart] => 0
[artikel_nr] => 33
[beschreibung_k] => HP LaserJet 4300 DTN
[bemerkung] => Super Toll
[anzahl_alle] => 1
[tax] => .16
[price] => 150.00
[currency] => EUR
[a_artikel_nr] => Q2434A
[parent_wk_id] =>
[sabg_id] => 88
)
[1] => Array
(
[kapitel] => 0024005101
[hhtitel] => 51143-785
[kstelle] => FUB
[kart] => 0
[artikel_nr] => 4614
[beschreibung_k] => Vergoldung des Druckers und Kabel
[bemerkung] =>
[anzahl_alle] => 1
[tax] => .16
[price] => 3999.00
[currency] => EUR
[a_artikel_nr] =>
[parent_wk_id] => 1
[sabg_id] => 88
)
[2] => Array
(
[kapitel] => 0024005101
[hhtitel] => 51143-785
[kstelle] => FUB
[kart] => 0
[artikel_nr] => 4331
[beschreibung_k] => Zus. Papierfach für HP LaserJet 4 Serie
[bemerkung] =>
[anzahl_alle] => 1
[tax] => .16
[price] => 128.00
[currency] => EUR
[a_artikel_nr] =>
[parent_wk_id] => 1
[sabg_id] => 88
)
)
)
and don't know how to loop through it in Smarty. In PHP I'd do something like echo $my_array[1][0]['tax'], but how can I run through a 3D array with the section command? The keys of the array are not ordered, so something like foreach ist needed, which simply goes from one to another.
TIA
Alex |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|