Home > Article > Backend Development > php chmod function tutorial_PHP tutorial
PHP chmod definition and usage The chmod attribute() function changes the permissions of the specified file, returning TRUE and FALSE if it fails successfully.
php chmod definition and usage
The chmod attribute() function changes the permissions of the specified file, returning TRUE if successful and FALSE on failure.
Grammar
chmod(file,mode)
|
Required. Specified file check | ||||
mode |
下面我们来看看实例吧。Required. Specify new permissions. The pattern of parameters consists of four numbers: first, the number is always zero, second number specifies the owner of the permission, third number specifies the permission, the user group of the owner, fourth number specifies the permission, others may have values (set multiple permissions , increase the number below): <!--?php<br /-->// Read and write for owner, nothing for 读写的人,没有为其他 chmod("test.txt",0600);// Read and write for 读写的主人,阅读别人 chmod("test.txt",0644);// Everything for 一切的主人,阅读和执行的其他人1 =Execute permission chmod("test.txt",0755);// Everything for 一切为了人,读的所有者的组 chmod("test.txt",0740); ?>2 = Write permission 4 =Read permission
|