September 2001
Intermediate to advanced
768 pages
32h 45m
English
array array([mixed variable], [mixed ...]) | variable | Variable to place into an array element |
| ... | Further elements |
Creates an array from provided values or key => value pairs.
Returns:
Array formed of the values or key/value pairs given as arguments
Description:
array() is a language construct used to create an array with zero or more elements. Each argument passed to the function is used as a single element for the array.
By default, the construct creates a numerically indexed array such as $array[0]. The indices start at 0 and increase by one for every element in the array. For example, this would create an array with five elements:
$list = array ('alpha', 'zappa', 'bravo', 4, 2); The first element (‘alpha’) would be stored at key ...
Read now
Unlock full access