Web | This Site

Learning PHP
Advanced PHP
PHP Function Reference
PHP Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM

| Home |  | References |  | Discussion Forums |  | About TP

# PHP Function chown()

## Syntax

bool chown ( string $filename, mixed $user );

## Definition and Usage

Attempts to change the owner of the file filename to user user. Only the superuser may change the owner of a file.

## Paramters

Parameter | Description
--- | ---
path | A path to the file.
user | A user name or number.

## Return Value

Returns TRUE on success or FALSE on failure.

## Example

Following is the usage of this function:

    <?php
    $path = "/home/httpd/html/index.php";
    $user_name = "root";
    chown($path, $user_name);
    ?>

Advertisement

Online Image Processing

Indian Baby Names