Array array type analysis instructions in PHP _php tutorial

Source: Internet
Author: User
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.
Copy CodeThe code is as follows:
$arr = Array (' A ', ' B ',5=> ' C ', ' d ', ' e ',6=> ' G ');
Echo '


Echo '
';


The result of the above code is

Copy CodeThe code is as follows:
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 back of the 6=> ' G '.

http://www.bkjia.com/PHPjc/322197.html www.bkjia.com true http://www.bkjia.com/PHPjc/322197.html techarticle 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 a key is not specified for a value, ...

  • 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.