A detailed _php tutorial on array type analysis in PHP

Source: Internet
Author: User
This article explains the analysis of array types in PHP
The array of PHP is an ordered map. A map is a type associated with a key and value.
The key of an array of PHP can be either a string type or an integer type. If key is a float type, it is automatically converted to an integer type.

If the maximum value of an index for a key,integer type is not specified for a value, the new key is the maximum value plus 1. If the new key is already assigned, the value will be overwritten.
$arr = Array (a,b,5=>c,d,e,6=>g);
Echo
;
Print_r ($arr);
;

Code Run Results
Array (
[0] = a
[1] = b
[5] = C
[6] = g
[7] = = e)

This way. Only so there is no value "D" because he was covered by the 6=>g of the back.
I hope this article can be of some benefit to you.

http://www.bkjia.com/PHPjc/486155.html www.bkjia.com true http://www.bkjia.com/PHPjc/486155.html techarticle This article explains the array type analysis in PHP. The array of PHP is an ordered map. A map is a type associated with a key and value. The key of an array of PHP can be either a string type or an int ...

  • Related Article

    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.