How to use Filesystem chown in PHP

In this article I am going to explain about chown function in PHP.
  • 1442

PHP chown() function

The filesystem chown function is used to change owner of the file , but condition is that only super user can changed the owner of file.

Syntax of chown function

chown(file, owner)

Parameters in chown function

It have two  parameter:

Parameter Description
file Path to the file for checking.
owner It specifies a new user.

Example of filesystem chown function

<html>

<body>
 

<?php

chown("C:\wamp\www\Dinesh\Mcn.txt","Dinesh Singh");

echo "New user is Dinesh Singh";

?>
 

</body>

</html>


Output:

chown funcction.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.