1. Variables in PHP do not need to be declared. the variables are identified by $. The naming rules of variables start with a letter or underline, followed by any character or underline. $ PI = 3.14; $ radius = 5; $ cir = $ PI * 2 * $ radius; 2. in PHP, arrays in PHP are actually implemented using hash tables. Therefore, no matter the string is used as the index or the number is mapped in PHP, The result corresponds to a number. In PHP, indexes can be left blank, for example, $ test [] = 1. $ test [] = 2. The default index starts from scratch, and the last one is greater than the integer of the previous one. Secondly, the print array can be printed using the print_r () function. 3. Introduction to foreach. The so-called foreach is actually a loop syntax for foreach ($ array as [$ key =>] [&] value) {code...} Where as is the keyword. [] Indicates optional, & indicates the address. Otherwise, the value is only a copy of the corresponding value of the array. 4. list () function and array list ($ var1, $ var2 ,...) = array; equivalent to $ var1 = array [0]; $ var2 = array [1];... $ varn = array [n-1]; each ($ array) function. The passed value is an array. The each function returns the current keyword/value pair and points the internal pointer to the next element. To put it bluntly, the each function returns an array, and the each function returns an encapsulated array with indexes 0, 1, key, and value, the value of the 0 index is the same as that of the key index, while the value of the 1 index is the same as that of the value. Why? This is used with the list () function to implement list ($ k, $ v) = $ array; that is, it is equivalent to $ k = $ array [0] and the value is equal to $ array ['key']; $ v = $ array [1] The stored value is equal to the value of $ array ['value. An array variable has a pointer that can be adjusted to point to an element in the array. Therefore, before using each time, make sure it points to the first one. You need to use the reset () function to reset it!