Name |
Description |
Example |
count() and sizeof() |
Returns the number of members. |
count($myOldArray) |
each() and list() |
Returns the contents of members. |
See foreach |
foreach() |
For reading through an array. |
foreach ($myOldArray as $c)
while(list($k, $v) = each ($c)) {
echo "$k ... $v ";
}
} |
array_keys() |
Returns all the key names in an array. |
$myKeysArray = array_keys($someArray); |
array_merge() |
Merges two arrays. |
$myNewArray = array_merge($myOldArray1, $myOldArray2); |
array_pop() |
Destructively reads the last member of an array. See also array_shift. |
$myLastMember = array_pop($myOldArray) |
array_push() |
Adds one (or more!) member to the end of an array. |
array_push($myOldArray, "newelement1", "newelement2", "newelement3",) |
reset() |
Sets the pointer to the beginning. |
reset($myOldArray) |
shuffle() |
FUBARs an array. |
shuffle($myOldArray) |
array_shift() |
Destructively reads the first member of an array. See also array_pop. |
$myFirstMember = array_pop($myOldArray) |
array_unshift() |
Adds one (or more!) member to the end of an array. See also array_push(). |
array_unshift($myOldArray, "newelement1", "newelement2", "newelement3",) |
|
|
|