mkdir("/path/to/my/dir", 0700);
Is the 0 in 0777 necessary?
0777中的0是必需的吗?
3 个解决方案
#1
11
Yes. The leading zero will make the number interpreted as octal number; without it would be interpreted as decimal number.
是的。前导零将数字解释为八进制数;没有它,将被解释为十进制数。
var_dump(0700); // int(448)
var_dump(700); // int(700)
#2
#1
11
Yes. The leading zero will make the number interpreted as octal number; without it would be interpreted as decimal number.
是的。前导零将数字解释为八进制数;没有它,将被解释为十进制数。
var_dump(0700); // int(448)
var_dump(700); // int(700)
#2
4
The leading zero indicates an octal value. See also the documentation of chmod.
前导0表示八进制的值。参见chmod的文档。