Anda di halaman 1dari 10

ARRAY IN PHP 5.

5
PHP 5.5, JOOMLA, WORDPRESS, DRUPAL, MAGENTO, CAKE PHP, ZEND
PHP CMS AND FRAMEWORKS

What is an Array?
Array is a memory allocation which is used to
store multiple data in a sequential memory
location with unique indexes.
With other programming language references
array is a collection of similar data types. But in
PHP we can store any data type in a single array.

Because in PHP we do not need to declare data
type before array initialization.
g!"
#data $ array%&'( )'( ).*( +php+,-
Here #data is an array which contain different
data types


.ypes of Array

/ingle dimensional or 0efault or 1ndex Based or


2umeric Array

Associati3e Array

4ultidimensional Array

Ad3antage of Array in PHP

We can store any data in a single array.

We can initialize indexes according to data or


our need.

We can access indexes of an array along with


their data.

A lots of Built"in array function for 3ery fast


web application de3elopment.

Array 5unctions

array%,

print6r%,

min%,

max%,

current%,

next%,

pre3%,

Array 5unctions

array6sum%,

array6unique%,

array6re3erse%,

array6push%,

array6pad%,

array6shift%,

array6unshift%,

Array 5unctions

/ort%,

rsort%,

asort%,

arsort%,

7sort%,

7rsort%,

u7sort%,

Array 5unctions

array67ey6exists%,

in6array%,

array6diff%,

array6diff6assoc%,

array6unique%,

array6merge%,

array6combine%,

Anda mungkin juga menyukai