英 [i:tʃ] US [itʃ]

adj.Every; each; their own

pron. Each; their own

php each() function syntax

Function:Return the key name and key value of the current element, and move the internal pointer forward

Syntax:each(array)

Parameters:

##array Required. Specifies the array to use.
Parameters Description

Description:Generate an array consisting of the key name and key value of the element pointed to by the current internal pointer of the array, and move the internal pointer forward . The returned array contains four elements: key 0, 1, key and value. Cells 0 and key contain the key names of the array cells, and 1 and value contain the data. If the internal pointer exceeds the range of the array, this function returns FALSE.

php each() function example


Run instance»

Click the "Run instance" button to view the online instance

Output:

Array ( [1] => php中文网 [value] => php中文网 [0] => 0 [key] => 0 )



Run Instance»

Click the "Run Instance" button to view the online instance

Output:

Array ( [1] => 无忌哥哥 [value] => 无忌哥哥 [0] => 0 [key] => 0 )