Javatpoint Logo
Javatpoint Logo

PHP ftp_chmod() Function

The ftp_chmod() function is used to set permissions on a specified remote file via FTP. This function was introduced in PHP 5.

Syntax:

Parameter Description Is compulsory
ftp_connection/stream The link identifier of the FTP connection. compulsory
mode The new permissions, given as an octal value. compulsory
filename The remote file. compulsory

Returns

This method returns the new file permissions on success or FALSE on error.

Example 1

Explanation

In the above program, we change the permission of file by using chmod() function and 644 means that files are readable and writeable by the owner of the file and readable by users in the group owner of that file and readable by everyone else.

Example 2

Explanation

In the above example, file permission change to 644 to 755.755, it means full permissions for the owner and read and execute permission for others.


Next TopicPHP FTP





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA