In my recurive function to zip a whole folders i have this piece of code glob($path. \'/*\') that give me all files and subfolders matching my $path.
Here I read
Have you tried this?
glob($path. '/{,.}*', GLOB_BRACE);