PHP function chmod()

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

Newsletter

Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.