Arrays in PHP

Arrays don’t have any special flavor added in PHP, the basic essence remains the same irrespective of any programming or scripting language.

An array is a data structure that contains values, all of the same type.

There are three types of arrays in PHP –

  1. Numeric array
  2. Associative arrays
  3. Multidimensional arrays

Numeric array: Arrays whose index is always a number.

OR

Associative arrays: Arrays whose index are string so as to establish a strong relationship.

OR

Multidimensional arrays: A single array can contain arrays as it’s elements.


Receive our updates to your inbox

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.