Home >> PHP >> chmod() function in PHP

chmod() function in PHP

The chmod() function used to changed file mod.

Returns true on success or false on failure.

Syntax

chmod(filepath,mode)

Example

// Read and write for owner, nothing for everybody else

chmod("/content/file.txt", 0600);

// Read and write for owner, read for everybody else
chmod("/content/file.txt", 0644);

// Everything for owner, read and execute for others
chmod("/content/file.txt", 0755);

// Everything for owner, read and execute for owner's group
chmod("/content/file.txt", 0750);

Post Your Comment

Next Questions
chown() function
clearstatcache() function
copy() function
delete() function
dirname() function
disk_free_space() function
disk_total_space() function
diskfreespace() function
feof() function
fflush() function
fgetc() function
fgetss() function
file_put_contents() function
fileatime() function
filectime() function
filemtime() function
fileowner() function
fileperms() function
filesize() function
filetype() function
flock() function
fputs() function
fscanf() function
fstat() function
ftell() function

Copyright ©2022 coderraj.com. All Rights Reserved.