Home > Backend Development > PHP Tutorial > php chmod function tutorial_PHP tutorial

php chmod function tutorial_PHP tutorial

WBOY
Release: 2016-07-20 11:00:29
Original
1197 people have browsed it

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)
Copy after login
Copy after login
	file
Copy after login
必需的。指定的档案检查
mode

必需的。指定新的权限。参数的模式由四个数字:一是数量始终为零第二个数字指定的权限的所有者第三若干规定的权限所有者的用户组第四若干规定的权限其他人可能值(设置多个权限,增加下面的编号) :

1 =执行权限

2 =写入权限

4 =读取权限

Required. Specified file check
mode
下面我们来看看实例吧。
Copy after login
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 读写的主人,阅读别人
Copy after login
chmod("test.txt",0644);// Everything for 一切的主人,阅读和执行的其他人
Copy after login
1 =Execute permission
chmod("test.txt",0755);// Everything for 一切为了人,读的所有者的组
Copy after login
chmod("test.txt",0740);
?> 
Copy after login
2 = Write permission
4 =Read permission

http://www.bkjia.com/PHPjc/445507.htmlwww.bkjia.com
truehttp: //www.bkjia.com/PHPjc/445507.html
TechArticlephp chmod definition and usage chmod attribute () function changes the permissions of the specified file, if it returns TRUE and FALSE successfully of failure. php chmod definition and usage changes to the chmod attribute ( ) function...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template