What is a one-dimensional php array? Details about one-dimensional php array instances

Source: Internet
Author: User
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.