lchown()
lchown() — Changes user ownership of symlink.
Built-in function of PHP 8.5. The manual lists it as available in PHP 5 >= 5.1.3, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
What it does
Attempts to change the owner of the symlink filename to user user.
Signature
lchown(string $filename, string|int $user): bool
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $filename | string | Path to the file. |
| $user | string|int | User name or number. |
Return value
Returns true on success or false on failure.
Example
A runnable snippet:
$target = 'output.php'; $link = 'output.html'; symlink($target, $link); lchown($link, 8);
See also
chown(), lchgrp(), chgrp(), chmod()
All PHP 8.5 built-in functions
Reference card built from the PHP manual page lchown() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.