Change permissions of a file in PHP

Description

The following code shows how to change permissions of a file.

Example


/* www  .ja  va 2  s .c om*/

<?php
    // Read and write for owner, nothing for everybody else
    chmod("test.txt",0600);

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

    // Everything for owner, read and execute for everybody else
    chmod("test.txt",0755);

    // Everything for owner, read for owner's group
    chmod("test.txt",0740);
?>




















Home »
  PHP Tutorial »
    File »




Directory
DirectoryIterator
Drive
File
File Permission
File Read Save
FileSystemIterator
Path
Zip