$array = array('first' => array(1, 3), 'second' => array(5,6), 'third' => array(8,4));
foreach($array as $a){
echo "key = " . key($a) . "\n";
};
如何从此数组中获取索引名称?我想收到:
key = first
key = second
key = third
但这在每种情况下都会返回我 key = 0。为什么?我怎样才能得到索引的名称?