30
Types of Array in PHP
We have three types of array :
![](https://res.cloudinary.com/practicaldev/image/fetch/s--hf5dfnzj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hump4renbhsi6dwh69ii.png)
Indexed Array
An array with a numeric key is known as the indexed array. Values are stored and accessed in linear order.
![](https://res.cloudinary.com/practicaldev/image/fetch/s--I1KYJZEU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgnlweylr4we203udmso.png)
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.
![](https://res.cloudinary.com/practicaldev/image/fetch/s--Raaixs0i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/93nzzmfp6m041sx6k268.png)
Multidimensional Array
An array containing one or more arrays within itself is known as a multidimensional array. The values are accessed using multiple indices.
![](https://res.cloudinary.com/practicaldev/image/fetch/s--Pb9h4MTQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/34nnhn7fbm7pe4211ddp.png)
30