PHP array type-numeric index array

Source: Internet
Author: User
A php numeric index array generally indicates the position of an array element in an array. it consists of digits. the subscript starts from 0. the default index value of a numeric index array starts from 0, you do not need to specify this parameter. PHP automatically assigns an integer to the key name of the index array, and then automatically increments the value. of course, you can also specify to save data from a certain position. PHP array type-numeric index array

What is a PHP digital index array?

This is the most common array type. most programming languages have numerical index arrays.

A php numeric index array generally indicates the position of an array element in an array. it consists of digits. the subscript starts from 0. the default index value of a numeric index array starts from 0, you do not need to specify this parameter. PHP automatically assigns an integer to the key name of the index array, and then automatically increments the value. of course, you can also specify to save data from a certain position.

An array can be constructed into a series of "key-value pairs", each of which is an array item or element ). Each item in the array corresponds to a key or index. The numeric index key value is as follows:

Case Study of the number index array:

 "PHP", "2" => "medium", "3" => "text", "4" => "net "); // declare the array print_r ($ array); // output the array element echo"
"; Echo $ array [1]; // output the value of the array element echo $ array [2]; // output the value of the array element echo $ array [3]; // output the value of the array element echo $ array [4]; // output the value of the array element?>

Output result:

The index array uses a 32-bit unsigned integer as the index number. The maximum size of the index array is 2-1, that is, 4,294,967,295. If the size of the array to be created exceeds the maximum value, a running error occurs.

The next chapter describes the PHP array type-associated array.

[Recommended tutorials]

1. related topic recommendations: php Array (Array)

The above is the PHP array type-details of the number index array. For more information, 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.