php associative array name?
Posted
by daniel Crabbe
on Stack Overflow
See other posts from Stack Overflow
or by daniel Crabbe
Published on 2010-06-01T16:39:55Z
Indexed on
2010/06/01
16:43 UTC
Read the original article
Hit count: 152
php
|associative-array
hello! Just trying to get the name of an assoc array;
$test = array('selected' =>$selected, 'sectionList'=>$sectionList, 'categoryList'=>$categoryList);
<? foreach($test as $list) { ?>
<h3><?=$list?>, <?=$list[id]?>, <?=$list['name']?>, <?=$list['value']?></h3>
<? } ?>
but either get 'Array' or nothing?! I can see the name when i print_r($test);
Do you think this is possible? Thanks in advance, D.
© Stack Overflow or respective owner