update page now

Voting

: one minus one?
(Example: nine)

The Note You're Voting On

arikan134 at gmail dot com
9 years ago
Check director is writable recursively. to return true, all of directory contents  must be writable

<?php
function is_writable_r($dir) {
    if (is_dir($dir)) {
        if(is_writable($dir)){
            $objects = scandir($dir);
            foreach ($objects as $object) {
                if ($object != "." && $object != "..") {
                    if (!is_writable_r($dir."/".$object)) return false;
                    else continue;
                }
            }    
            return true;    
        }else{
            return false;
        }
        
    }else if(file_exists($dir)){
        return (is_writable($dir));
        
    }
}

?>

<< Back to user notes page

To Top