Recursive CHMOD with PHP


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?phpfunction chmod_R($path, $filemode) {$dh = opendir($path);while ($file = readdir($dh)) {if($file != '.' && $file != '..') {$fullpath = $path.'/'.$file;echo 'chmod ' .$filemode.' '.$fullpath. "<br />";chmod($fullpath, $filemode);echo '<br />';if(is_dir($fullpath)) {chmod_R($fullpath, $filemode);} }}closedir($dh);}chmod_R('.', 0777);?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.