function glob_deep($path) {
    if (is_dir($path)) {
        if ($dh = opendir($path)) {
            while (false !== ($file = readdir($dh))) {
                if ($file[0] != '.') {
                    $dir = is_dir($path.'/'.$file);
                    if (!$dir) {
                        $aFiles[] = $file;
                    } else {
                        $aFiles[$file] = glob_deep($path.$file.'/');
                    }
                }
            }
            closedir($dh);
        }
    }
    return isset($aFiles) ? $aFiles : false;
}