glob(\"aaafolder/*php\")
glob(\"bbbfolder/*php\")
glob(\"cccfolder/*php\")
Is it possible to simplify this?
glob(\"(?=aaafolder/*p
As the PHP manual said, its the GLOB_BRACE
flag.
glob("{aaafolder/*php,bbbfolder/*php,cccfolder/*php}", GLOB_BRACE)
This note on the manual page of glob()
seems to answer your question, saying that glob is not limited to a single directory : using GLOB_BRACE
, you can specify several directories.
I'm quoting the example that @Ultimater
gives there :
$results=glob("{includes/*.php,core/*.php}",GLOB_BRACE);
User-notes on the manual pages often contain useful informations and examples ;-)