php chmod 函数 改变文件模式_PHP教程
Jul 20, 2016 am 11:00 AM在我们操作文件时经常会经用chmod函数来改变指定目录的操作权限哦,
在我们操作文件时经常会经用chmod函数来改变指定目录的操作权限哦,
属性
( PHP 4中, PHP 5中)
搭配chmod -改变文件模式
描述
布尔属性(字符串$文件名,国际$模式)
企图改变模式指定的文件,以所提供的模式。
参数
文件名
文件路径。
模式
请注意,模式是不会自动假定为八进制值,所以字符串(如“克+瓦特” )将无法正常工作。为了确保预期的操作,你需要前缀模式下零( 0 ) :
chmod("/somedir/somefile", 755); // decimal; probably incorrect
chmod("/somedir/somefile", "u+rwx,go+rx"); // string; incorrect
chmod("/somedir/somefile", 0755); // octal; correct value of mode
?>
该模式参数包含三个八进制数组成部分指定准入限制的所有者,用户组中的主人是在和其他人一样在这一秩序。一个组成部分可以计算,增加了必要的权限,这个目标用户群。编号1意味着您授予执行权, 2号意味着你的档案写入, 4号意味着你的档案可读性。购买了这些数字来指定需要的权利。您也可以阅读更多关于模式与Unix系统'男子1属性'和'人2属性。
// Read and write for owner, nothing for everybody else
chmod("/somedir/somefile", 0600);
// Read and write for owner, read for everybody else
chmod("/somedir/somefile", 0644);
// Everything for owner, read and execute for others
chmod("/somedir/somefile", 0755);
// Everything for owner, read and execute for owner's group
chmod("/somedir/somefile", 0750);
?>
编辑推荐函数:

Heißer Artikel

Hot-Tools-Tags

Heißer Artikel

Heiße Artikel -Tags

Notepad++7.3.1
Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version
Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1
Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6
Visuelle Webentwicklungstools

SublimeText3 Mac-Version
Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

Heiße Themen

PHP 8.4 Installations- und Upgrade-Anleitung für Ubuntu und Debian

So richten Sie Visual Studio-Code (VS-Code) für die PHP-Entwicklung ein
