Professional Documents
Culture Documents
indexed array
associative array
multidimensional array
Index array - An indexed or numeric array stores each array element with a numeric index.
<?php $colors = array("Red", "Green", "Blue"); ?>
<?php $colors[0] = "Red"; $colors[1] = "Green"; $colors[2] = "Blue"; ?>
Associative array - In an associative array, the keys assigned to values can be user defined strings.
for example - <?php $colors = array("red"=>22, "green"=>32, "blue"=>28); ?>
<?php $colors["red"] = "22"; $ages["green"] = "32"; $ages["blue"] = "28"; ?>
Multidimensional array - The multidimensional array is an array in which each element can also be an
array and each element in the sub-array can be an array or further contain array within itself and so
on.