Skip to content

Instantly share code, notes, and snippets.

@ptasker
Created August 7, 2012 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptasker/3288297 to your computer and use it in GitHub Desktop.
Save ptasker/3288297 to your computer and use it in GitHub Desktop.
PHP Include all files in a directory
<?php
$the_dir = "/var/www/foo/bar/includes/";
foreach ( glob( $the_dir . '*.php' ) as $file )
{
require_once $file;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment