An array data structure, or simply an array, is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored so that the position of each element can be computed from its index

There are three basic types:

Indexed Array: Arrays with sequential numeric index, such as 0,1,2 etc.

Associative Array:This is the most frequently used type of PHP Arrays whose elements are defined in key/value pair.

Multidimensional Array: Arrays whose elements may contains one or more array.

Numeric Array

OUTPUT

1  2  3
1  2  3  4  5  6  7  8

Associative Array

OUTPUT

1  Arvind_Ahir  95307  Arvind  Ahir

Multiple Array

OUTPUT

SnoUsernamePhoneName
1Arvind_Ahir9501S-ERVERArvind Ahir
2Abhi_ahir9502S-ERVERAbhi Ahir

 

(Visited 28 times, 1 visits today)

Written by: