Gen. partnerAlgotech

PHP function chmod()

Sets file access rights (read, write, delete).

|
September 11, 2019

Availability in PHP 4.0

Sets file access rights (read, write, delete).

Parameters

Parameter Data type Default value Note
$filename string not File path (absolute is recommended)
$mode int not Access rights (for example 0777 - everyone has access). Note: Rights will be automatically converted to hexadecimal. Writing as a string (for example g+w is not supported). If you want to enter a number in decimal, enter zero as the first digit (for example 0654).

Return values

bool

Returns true if everything went fine, false if an error occurred.

Additional resources

Official chmod documentation

Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.