This note on the glob() manual page seems to answer your question that glob is not limited to one directory: using GLOB_BRACE , you can specify multiple directories.
I quote the example that @Ultimater gives there:
$results=glob("{includes/*.php,core/*.php}",GLOB_BRACE);
User notes on manual pages often contain useful information and examples; -)
Pascal martin
source share