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" }conclusion
在array中,類似 '12345'、'9894321'、'92233720368547758577575753372036854775853337203685小於等於PHP_INT_MAX,都按numeric處理;
當其值大於PHP_INT_MAX,都按string處理;
以上就介紹了array解析,包含了方面的內容,希望對PHP教程有興趣的朋友有所幫助。