PHP lchown() Function

❮ PHP Filesystem Reference

Example

Change the user ownership of a symbolic link:

<?php
$target = "downloads.php";
$link = "downloads";
symlink($target, $link);

lchown($link, 8)
?>


Definition and Usage

The lchown() function changes the user ownership of a symbolic link.

Note: This is not an HTML link, but a link in the filesystem.

Note: This function does not work on Windows platforms.

Syntax

lchown(file, group)

Parameter Values

Parameter Description
file Required. Specifies the path to the symlink
group Required. Specifies the new user by name or number


Technical Details

Return Value: TRUE on success, FALSE on failure
PHP Version: 5.1.3+

❮ PHP Filesystem Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.