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?
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?
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;
}