PHP study notes 02 array 1. create an array: $ usersarray (a, B); change the value of the array $ users [0] c; for ($ i1; $ I & lt; 10; $ I ++) {& nbsp; $ users [$ I];} count the number of arrays count () foreach ($ usersas $ key & gt; $ value) {& nbsp; & nb PHP study notes 02
Array
1. create an array:
$ Users = array ("a", "B ");
Change the value of the array $ users [0] = "c ";
For ($ I = 1; $ I <10; $ I ++ ){
$ Users [$ I];
}
Count ()
Foreach ($ users as $ key => $ value ){
Echo $ value;
}
Create an array of custom keys
$ Test = array {"key" => "value "}
Access Data $ test ["key"]
Append an array
$ Test ["new"] = "test ";
List ($ a, $ B) copies the array data to $. List can only recognize arrays of subscript digits. The custom string key cannot be identified.
Rest () points the array pointer to the first unit
Array_unique remove duplicate values
Array_flip swap the key and value of the array
Two-dimensional array:
$ Array = array (...))
An array can contain multiple variables of different types.
Print_r () print easy-to-understand information