Skip to content

Instantly share code, notes, and snippets.

@bryanrsebastian
Created September 20, 2017 01:27
Show Gist options
  • Save bryanrsebastian/a26d36c3d985a360e1ac91a861cc8593 to your computer and use it in GitHub Desktop.
Save bryanrsebastian/a26d36c3d985a360e1ac91a861cc8593 to your computer and use it in GitHub Desktop.
<?php
/**
* Include all php inside the folder
* @param string $folder folder name
* @return void include all the php inside the folder that you enter.
*/
if ( ! function_exists( 'include_all_php' ) )
{
function include_all_php( $folder )
{
foreach ( glob( dirname(__FILE__)."/{$folder}/*.php" ) as $filename )
{
include_once( $filename );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment