array解析

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原創
2016-08-08 09:31:411274瀏覽

code

<?php
/**
 * Created by deshengkong.
 * Date: 14/12/23
 * Time: 下午8:07
 */

echo &#39;PHP version:&#39;. 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);

result

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教程有興趣的朋友有所幫助。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
上一篇:nginx的spdy協議下一篇:nginx的spdy協議