我的代码是:
$arr=[02,05,07,08,09]; print_r($arr)
输出是:
Array ( [0] => 2 [1] => 5 [2] => 7 [3] => 0 [4] => 0 )
为什么它将08和09转换为0?
它被认为是八进制数.因为你从零开始.
原文链接:https://www.f2er.com/php/130468.html$a = 1234; // decimal number $a = -123; // a negative number $a = 0123; // octal number (equivalent to 83 decimal) $a = 0x1A; // hexadecimal number (equivalent to 26 decimal) $a = 0b11111111; // binary number (equivalent to 255 decimal)