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