Letztens hatte ich ein mehrdimensionales, gemischtes Array und musste auf eine konkrete Position zugreifen.
Sah ungefähr so aus:
$row = 1;
$col = 5;
$id = 123;
$array[$row]['DATA'][$col] = array(
'ID' => $id,
'TEXT' => "test1",
'TEXT2' => "test2");
$smarty->assign('options',$array);
und in smarty dann so:
{foreach name=outer item=options_data from=$options}
{if $options_data.DATA[5].ID == 123}
//tu was
{/if}
{/foreach}
Ich glaub jetzt nicht das das jemanden hilft…aber ich hatte es mir notiert, das ich es hier in Blog schreiben möchte.
Well done…
Letzte Kommentare