Array in PHP

array in php
Array in PHP



Array in PHP

A PHP array is a variable that stores more than one piece of related data in a single variable. or An array is a special variable, which can hold more than one value at a time.
For example if you want to store 50 numbers then instead of defining 50 variables it’s easy to define an array of 50 length.
There are three different types of arrays and each array value is accessed using ID which is called index (array index) -

  • Indexed array — An array with a numeric key.
  • Associative array — An array where each key has its own specific value.
  • Multidimensional array — An array containing one or more arrays within itself.



Post a Comment

0 Comments