Copy code The code is as follows:
/*
* 1. Overview of arrays
* 1. The essence of arrays: manage and operate a set of variables, batch processing
* 2. Arrays Composite type (can store multiple)
* 3. Arrays can store data of any length and any type of data
* 4. Arrays can complete the functions of other language data structures (linked lists, queues, stacks, sets Class)
*
*
*
* 2. Classification of arrays
* There are multiple units in the array, (units are called elements)
* Each element (subscript [key] and value)
* Single access element Sometimes, elements are accessed through subscripts (keys)
* 1. One-dimensional array, two-dimensional array, three-dimensional array. . . Multidimensional array
* (an array of arrays means that other arrays are stored in the array)
* 2. There are two types of arrays in PHP
* Index array: the subscript is the index of a sequential integer
* Associative array: it is the subscript It is a string as an index
*
* There are only two subscripts (integer, string)
*
*
* 3. Multiple declaration methods of arrays
*
* 1. Directly assign a value to the array element declaration
* If the index If the subscript is not given, the sequential index will start from 0
* If the index subscript is given, the next one will be incremented by 1 from the largest
* If the previous subscript appears later, if it is an assignment, it will be the previous element Reassignment
* When mixed declaration, index and association do not affect each other (does not affect the declaration of index subscript)
*
* 2. Use the array() function to declare
* The default is an index array
* If specified for an associative array and an index array Subscript, use key => value
* Use " , " to split
* between multiple members 3. Use other function declarations
*
*
*
*
*/
//Index array
$user[ 0]=1;//User serial number
$user[1]="zhangsan";//User name
$user[2]=10;//Age
$user[3]="nan";//Gender
echo '
'; <br>print_r($user); <br>echo '';
The above introduces the array declaration of photoshop learning forum and php learning, including the content of photoshop learning forum. I hope it will be helpful to friends who are interested in PHP tutorials.