An array is a collection of several variables of the same type. when these variables are referenced, the same name can be used. An array is composed of consecutive storage units. the lowest address corresponds to the first element of the array, and the highest address corresponds to the last element. the array can be one-dimensional or multidimensional.
What is a one-dimensional php array?
A one-dimensional array is a single array consisting of numbers in a simple sort structure. Is the basis of two-dimensional arrays and multi-dimensional arrays.
An array is a collection of several variables of the same type. when these variables are referenced, the same name can be used. An array is composed of consecutive storage units. the lowest address corresponds to the first element of the array, and the highest address corresponds to the last element. the array can be one-dimensional or multidimensional.
Details about one-dimensional php array instances
One-dimensional array in computer languages
(1) an array is a set of ordered data. The data in the array is arranged regularly, and the subscript represents the sequence number of the data in the array.
(2) use an array name (such as s) and subscript (such as 14) to uniquely determine the elements in the array. for example, s represents the scores of 15th students.
(3) each element in the array belongs to the same data type. Different types of data (such as student scores and student gender) cannot be placed in the same array.
When an array element is a variable, it is called a one-dimensional array. A one-dimensional array is the most common array, which stores only one column of content.
The general form of declaring a one-dimensional array is:
Example of a one-dimensional PHP array:
"PHP", 2 => "Chinese", 3 => "net"); print_r ($ array);?>
Output result:
[Recommended tutorials]
1. related topic recommendations: php Array (Array)
What is the above one-dimensional php array? For more details about the php one-dimensional array instance, see other related articles in the first PHP community!