|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-06-15 11:41 UTC] rasmus
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 11:00:01 2025 UTC |
each each -- return next key/value pair from an array WRONG! it returns the current pair and advances the pointer Description array each(array array); Returns the next key/value pair from the array array. This pair is returned in a four-element array, with the keys 0, 1, key, and value. ^DITTO Elements 0 and key each contain the key name of the array element, and 1 and value contain the data. Example 1. each() examples $foo = array( "bob", "fred", "jussi", "jouni" ); $bar = each( $foo ); $bar now contains the following key/value pairs: 0 => 0 1 => 'bob' key => 0 value => 'bob' $foo = array( "Robert", => "Bob", "Seppo" => "Sepi" ); SYNTAX ERROR: remove , after "Robert"