lchown() function in PHP


The lchown function changes user ownership of symbolic link. The function returns TRUE on success and FALSE on failure.

Note − This function is not implemented on Windows platforms.

Syntax

lchown(file_path, user)

Parameters

  • file_path − Specify the path of file. Required.

  • user − Specify user name or number.

Return

The lchown() function returns TRUE on success and FALSE on failure.

Example

<?php
   $target = new.php';
   $mylink = new.html';
   symlink($target, $mylink);
   lchown($mylink, 8);
?>

Output

TRUE

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 24-Jun-2020

22 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements