Home >Backend Development >PHP Tutorial >javascriptarray Array array type analysis instructions in PHP
The key of the PHP array can be of string type or integer type. If the key is a float type, it will be automatically converted to an integer type.
If a key is not specified for a value, and the maximum value of the integer type index has been given, the new key is the maximum value plus 1. If the new key has been assigned, then the value will be overwritten.
Copy the code The code is as follows:
$arr = array('a','b',5=>'c','d','e',6= >'g');
echo '
'; <br>print_r($arr); <br>echo '';
Copy code Code As follows:
Array(
[0] => a
[1] => b
[5] => c
[6] => g
[7] => e)
The above introduces the array array type analysis instructions in javascriptarray PHP, including the content of javascriptarray. I hope it will be helpful to friends who are interested in PHP tutorials.