PHP array is a function that allows operations on arrays. PHP supports single-dimensional and multi-dimensional arrays. It also provides functions for constructing arrays using database query results.
Installation
The array function is an integral part of the core of PHP. These functions can be used without installation.
In PHP, there are three types of arrays: (Recommended learning: PHP video tutorial)
Numeric array - with numeric ID key Arrays
Associative arrays - arrays with specified keys, each key associated with a value
Multidimensional arrays - Arrays containing one or more arrays
Definition and Usage
array() Creates an array, with keys and values. If the key is omitted when specifying the array, an integer key is generated that starts at 0 and increments by 1.
To create an associative array with array(), use => to separate the keys and values.
To create an empty array, do not pass parameters to array():
$new = array(); Note: array() is actually a Language construct is usually used to define an array of literals, but its usage is very similar to that of functions, so we also list it in the manual.
The above is the detailed content of What does array mean in php. For more information, please follow other related articles on the PHP Chinese website!