final public static function isDirEmpty($dir)
    {
        if (!is_readable($dir)) {
            return (null);
        }
        $handle = opendir($dir);
        while (false !== ($entry = readdir($handle))) {
            if ($entry != "." && $entry != "..") {
                return (false);
            }
        }
        return (true);
    }
final public static function isDirEmpty($dir)
    {
        if (!is_readable($dir)) {
            return (null);
        }
        $handle = opendir($dir);
        while (false !== ($entry = readdir($handle))) {
            if ($entry != "." && $entry != "..") {
                return (false);
            }
        }
        return (true);
    }
final public static function isDirEmpty ( $ dir ) { if ( ! is_readable ( $ dir ) ) { return ( null ) ; } $ handle = opendir ( $ dir ) ; while ( false !== ( $ entry = readdir ( $ handle ) ) ) { if ( $ entry != "." && $ entry != ".." ) { return ( false ) ; } } return ( true ) ; }
Check if dir is empty or not
@param $dir string Dir path
@return bool|null If empty or not
Check if dir is empty or not