code
<?php /** * Created by deshengkong. * Date: 14/12/23 * Time: 下午8:07 */ echo 'PHP version:'. phpversion() . PHP_EOL; $arr2 = array( 1 => 'giraffe', '2' => 'panda', 9223372036854775806 => 'bird', '9223372036854775807' => 'deer', '9223372036854775808' => 'pig' ); echo 'PHP_INT_MAX:' . PHP_INT_MAX . PHP_EOL; var_dump($arr2);
PHP version:5.6.2 PHP_INT_MAX:9223372036854775807 array(5) { [1] => string(7) "giraffe" [2] => string(5) "panda" [9223372036854775806] => string(4) "bird" [9223372036854775807] => string(4) "deer" '9223372036854775808' => string(3) "pig" }
In array, when values like '12345', '9894321', '9223372036854775807' are used as keys,
when its value is less than Equal to PHP_INT_MAX, press both Numeric processing;
When its value is greater than PHP_INT_MAX, it is processed as string;
The above has introduced array parsing, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.