I'm sure this is a super simple and built-in function in PHP, but I haven't seen it yet.
Here is what I am doing at the moment:
foreach($array as $key => $value) { echo $key;
Can I do something like the following and thereby save myself from writing "$ key => $ value" in each foreach loop? (Psuedocode)
foreach($array as $subarray) { echo arrayKey($subarray);
Thank!
Array:
Array ( [subKey] => Array ( [value] => myvalue ) )
arrays php multidimensional-array key
Industrial Jul 23 '10 at 11:54 2010-07-23 11:54
source share