boggled by the each() function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
permutations
Forum Commoner
Posts: 52
Joined: Sat Dec 07, 2002 11:45 am

boggled by the each() function

Post by permutations »

Could someone explain to me how the each function works. I've read the manual, but it makes no sense to me. Why would the key name and value be returned TWICE for each element. I've tried to find another source to explain it in different words, but everything quotes the manual.

Thanks in advance.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

there is no real reason. It's just implemented this way.
You can access the array either by 0/1 or key/value - as you wish ;)
Post Reply