is readable recursively. Check all sub directories and files readable
<?php
function is_readable_r($dir) {
if (is_dir($dir)) {
if(is_readable($dir)){
$objects = scandir($dir);
foreach ($objects as $object) {
if ($object != "." && $object != "..") {
if (!is_readable_r($dir."/".$object)) return false;
else continue;
}
}
return true;
}else{
return false;
}
}else if(file_exists($dir)){
return (is_readable($dir));
}
}
?>