最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
chown()函数 实例教程
时间:2022-07-02 09:59:01 编辑:袖梨 来源:一聚教程网
chown
( PHP 4中, PHP 5中)
chown-更改文件所有者
描述
布尔chown(字符串$文件名,混合$用户)
企图改变档案的拥有者档案到用户的用户。只有Supervisor可以改变人的档案。
参数
文件名
文件路径。
用户
用户名或号码。
返回值
返回TRUE或FALSE的成功失败。
实例
// File name and username to use
$file_name= "foo.php";
$path = "/home/sites/php.net/public_html/sandbox" . $file_name ;
$user_name = "root";
// Set the user
chown($path, $user_name);
// Check the result
$stat = stat($path);
print_r(posix_getpwuid($stat['uid']));
?>
The above example will output something similar to:
array(7) {
["name"]=>
string(13) "php.net"
["passwd"]=>
string(1) "x"
["uid"]=>
int(148864)
["gid"]=>
int(148910)
["gecos"]=>
string(13) "php.net"
["dir"]=>
string(25) "/home/sites/php.net"
["shell"]=>
string(13) "/sbin/nologin"
}
站长推荐:
相关文章
- 三角洲行动scar性价比改装 scar热门改装方案分享 09-14
- 原神6.0新圣遗物秘境位置是什么 纺月穹境秘境路线 09-14
- 合金装备3重制版多利诺博多诺小黄鸭位置攻略 多利诺博多诺小黄鸭在哪 09-14
- 三角洲行动ak12怎么改 ak12最稳改装分享 09-14
- 三角洲行动sg552怎么改 sg552改装后座力控制65 09-14
- 三角洲行动m7最强改装 m7改装方案全面战场改装 09-14