watagal Posted May 6, 2008 Share Posted May 6, 2008 Greetings, thanks for all the help so far.I have an assciative array being processed by a foreach loop - How can I extract the key name?foreach ($arr as $a) { echo $a-keyname . ' value is ' . $a;}As always, I'v checked W3 and did a search here,TIA, GAl Link to comment Share on other sites More sharing options...
boen_robot Posted May 6, 2008 Share Posted May 6, 2008 Use the extended foreach notation, as desribed in the PHP manual, i.e. foreach ($arr as $k=>$a) {echo $k;} Link to comment Share on other sites More sharing options...
watagal Posted May 6, 2008 Author Share Posted May 6, 2008 Wow!Before I can even edit (correct) ny initial post, the answer is here. You guys are great! Gal Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.