thiggins09 Posted July 25, 2007 Share Posted July 25, 2007 Hi, If I used a "for each" to go through an array or irregularly numbed keys, is there a way to get the key number that the loop is currently on each time? Quote Link to comment Share on other sites More sharing options...
trq Posted July 25, 2007 Share Posted July 25, 2007 <?php foreach($arr as $k => $v) { echo "This is index number $k with a value of $v\n"; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.