Wednesday, 11 June 2014

What is array in PHP?


What is array in PHP?

An array is a variable that stores a set or sequence of values. One array can have many elements and each element can hold a single value such as text or numbers or another array. An array containing other arrays is known as a multidimensional array.

There are three types of array in PHP.

(1) Numeric array
(2) Associative array
(3) Multidimensioanl array

Numeric array : An Array with a numeric index. Values are stored and accessed in linear fashion.

Asscociative array : An array with strings as index. This stores element values in association with key values rather than in a strict linear index order.

Multidimension array : This array contain one or more array or sub-array.

No comments: