php8.5
Home/ Manual/ filesystem / functions/ lchown

lchown

PHP function Edit on GitHub ✎

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

Changes user ownership of symlink

Description

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

Attempts to change the owner of the symlink filename to user user.

Only the superuser may change the owner of a symlink.

Parameters

filename

Path to the file.

user

User name or number.

Return Values

Success

Examples

Changing the owner of a symbolic link

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

lchown($link, 8);
?>

Notes No-remote No-windows

See Also

Source: reference/filesystem/functions/lchown.xml · from the official PHP manual (php/doc-en)