Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は..のようなZerofill値を持つ引数を持つphp配列を持っています.
$a = (00001, 00008, 00009, 00012);
この配列を関数のパラメーターとして使用すると、次のような予期しない結果が得られます...
print_r($a); //prints array ( [0]=>1 [1]=>0 [2]=>0 [3]=>1 )
なんで?そして、このエラーにどのように対処しますか???
先行ゼロの数値は8 進数表記です。数値の前にゼロを付ける必要がある場合は、文字列関数を使用できます。
これを試して
$a = array('00001', '00008', '00009','00012');