DEV Community


Types of Array in PHP

Moataz khaled
・1 min read

We have three types of array :

Alt Text

Indexed Array

An array with a numeric key is known as the indexed array. Values are stored and accessed in linear order.

Alt Text

Associative Array

An array with strings for indexing elements is known as the associative array. Element values are stored in association with key values rather than in strict linear index order.

Alt Text

Multidimensional Array

An array containing one or more arrays within itself is known as a multidimensional array. The values are accessed using multiple indices.

Alt Text

Discussion (0)