Return to Snippet

Revision: 3726
at September 7, 2007 06:55 by nicolaspar


Initial Code
function require_once_dir( $path ){
	$dir = dir($path);
	while(($file = $dir->read()) !== false)
		if( is_file($path .'/'. $file) and preg_match('/^(.+)\.php$/i', $file) )
			require_once($path .'/'. $file);		
	$dir->close();
}
#Example
require_once_dir( 'lib/db' );
require_once_dir( 'lib/email' );

Initial URL

                                

Initial Description

                                

Initial Title
PHP - Require Dir Files .php

Initial Tags
php

Initial Language
PHP