Main references:
1. PHP Official manual: http://php.net/manual/zh/language.types.array.php
Basic meaning:
The array in PHP is actually an ordered map. A map is a type that associates values to the keys . This type is optimized in many ways, so it can be used as a real array, or as a list (vector), a hash (an implementation of a mapping), a dictionary, a collection, a stack, a queue, and more possibilities. Because the value of an array element can also be another array, the tree structure and the multidimensional array are also allowed.
TIP: An array can be a two-dimensional array, or a three-dimensional array. Please read the Baidu Encyclopedia: array: Http://baike.baidu.com/view/209670.htm?fr=aladdin
Basic syntax:
Defines an array of arrays ()
You can use the array () language structure to create a new array. It can contain any number of pairs of key=>value, but the key=>value is separated by a "," (comma).
The structure is like this:
Index array:
1 <? PHP 2 $myArray Array (' mother ', ' father ', ' sister ', ' brother '); 3 Print_r ($myArray); 4 ?>
Associate Array:
1 <? PHP 2 $myArray Array (' Mom ' = ' mother ', ' papa ' = ' father ', ' sister ' = ' sister ', ' elder brother ' = ' brother '); 3 Print_r ($myArray); 4 ?>
You can even mix the two (in fact PHP itself does not differentiate between the index array and the associate array):
1 <? PHP 2 $myArray Array (' Mom ' = ' mother ', ' papa ' = ' father ', ' sister ', ' brother '); 3 Print_r ($myArray); 4 ?>
Just power outage, all efforts are not saved, OK, let me hurt heart reply, and then start to write it ~ ~
My understanding of the PHP array