Using the chown() and chgrp() Functions : chgrp « File Directory « PHP






Using the chown() and chgrp() Functions

 
<?php
     $dr = @opendir("/tmp/");
     if(!$dr) {
          echo "Error, couldn't open /tmp/!";
          exit;
     }

     while(($filename = readdir($dr)) !== false) {

          chown($filename, "php");
          chgrp($filename, "phpgroup");
     }
          closedir($dr);
?>
  
  








Related examples in the same category