Reputation: 1098
For a php application I want to search directories for specific subdirectories where I want to require all files in this directories.
The path would look like so:
/app/*/route/*.php
How can I do this?
Upvotes: 0
Views: 45
Reputation: 15141
using glob function help you in achieving this.
glob('/app/*/route/*.php');
For requiring all those files can use this
foreach(glob('/app/*/route/*.php') as $file)
{
require_once $file;
}
Upvotes: 1