Easy as pie!
Here’s an example to include all PHP files in a subdirectory named class.
N.B. Make sure you are one level below the class folder.
foreach (glob(plugin_dir_path(__FILE__) . "class/*.php") as $filename) include $filename;…
As I was developing a plugin I needed it to create a directory named “biap_uploads” below /WP_ROOT/wp-content/uploads/ (i.e. /WP_ROOT/wp-content/uploads/biap_uploads) upon its activation. I thought no task better than to write my first how-to for WordPress Plugin development than here.