glob() contains a list of hidden files (files starting with . , including directories . and .. ), but only if you explicitly ask it:
glob(".*");
Filtering the returned glob() array for .htaccess entries with preg_grep :
$files = glob(".*") AND $files = preg_grep('/\.htaccess$/', $files);
An alternative to glob, of course, would be to simply use scandir() and a filter ( fnmatch or regular expression):
preg_grep('/^\.\w+/', scandir("."))
mario source share