为什么 php 数组不支持 Zerofill 参数

Why php array not support Zerofill arguments

我有一个 php 数组,其参数带有 Zerofill 值,例如..

$a = (00001, 00008, 00009, 00012);

当我使用这个数组作为函数的参数时,它给出了意想不到的结果,比如...

print_r($a); //prints

array  ( [0]=>1  [1]=>0  [2]=>0  [3]=>1 )

为什么?我们将如何解决这个错误???

试试这个

$a = array('00001', '00008', '00009','00012');

Numbers with leading zero are the octal notation. If you need to prepend numbers by leading zeros you can use 字符串函数。