Share on Google+Share on Google+

PHP chmod, PHP chmod Example

The example of chmod() function in PHP. Learn how to use PHP chmod() in your PHP program.

In this section we will learn how to use the chmod() function in the PHP program. The chmod() function allows the developers to change the permission of the file. 


bool chmod(filename,mode types)

The chmod() function is used to change the read ,write, execute permission of  user, group, other. This command available for the unix/linux os. It is not supposed to work on the windows machine

The chmod() function returns true or false.

Mode has four numbers   for the user, group and other

It has first as 0 and other  three are sum of 1,2,4 i.e 1 or 2 or 3 or 4 or 5 or 6 or 7

1 -execute permission ,2 -write permission,3 -read permission










Posted on: September 21, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null