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? Link to comment https://forums.phpfreaks.com/topic/61702-array-keys/ 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"; } ?> Link to comment https://forums.phpfreaks.com/topic/61702-array-keys/#findComment-307162 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.