PHP 8.3.4 Released!

lchown

(PHP 5 >= 5.1.3, PHP 7, PHP 8)

lchown修改符号链接的所有者

说明

lchown(string $filename, string|int $user): bool

尝试修改符号链接 filename 的 所有者 user

只有超级用户任意修改符号链接的所有者。

参数

filename

文件路径。

user

所有者名称或编号

返回值

成功时返回 true, 或者在失败时返回 false

示例

示例 #1 Changing the owner of a symbolic link

<?php
$target
= 'output.php';
$link = 'output.html';
symlink($target, $link);

lchown($link, 8);
?>

注释

注意: 此函数不能作用于远程文件,被检查的文件必须是可通过服务器的文件系统访问的。

注意: 此函数未在 Windows 平台下实现。

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top