PHP chmod, PHP chmod Example


 

PHP chmod, PHP chmod Example

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

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. 

syntax 

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

code

<?php

chmod("c:/rose1/ss.java",0600);

chmod("c:/rose1/ss.java",0600);

chmod("c:/rose1/ss.java",0600);

?>

 

Ads