PHP - Getting the index of a element from a array

decoder

New Member
How can I get the current element number when I'm traversing a array?I know about count(), but I was hoping there's a built-in function for getting the current field index too, without having to add a extra counter variable.like this:\[code\]foreach($array as $key => value) if(index($key) == count($array) ....\[/code\]
 
Back
Top