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:

ParameterDescriptionIs compulsory
ftp_connection/streamThe link identifier of the FTP connection.compulsory
modeThe new permissions, given as an octal value.compulsory
filenameThe 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




Latest Courses