bool chmod ( string $filename, int $mode );
尝试将指定文件的模式更改为模式中给定的模式。
filename - 文件路径。
mode - 请注意,不会自动将mode假定为八进制值,因此字符串(例如“ g + w”)将无法正常工作。 为了确保预期的操作,您需要在模式前加上零(0)
成功时返回TRUE,失败时返回FALSE。
<?php //Read and write for owner, nothing for everybody else chmod("hello.txt", 0600); //Read and write for owner, read for everybody else chmod("hello.txt", 0644); //Everything for owner, read and execute for others chmod("hello.txt", 0755); //Everything for owner, read and execute for owner's group chmod("hello.txt", 0750); ?>
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)