Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fast_cat_ii( $path = '', $ext = array(), $type = __FILE__ )
- {
- if( !is_array( $ext ) )
- {
- $ext = array( $ext );
- }
- $cat = array();
- $iterator = new DirectoryIterator( dirname( $type ) );
- while( $iterator -> valid() )
- {
- $test = $iterator -> getFilename();
- foreach( $ext as $test_ext )
- {
- if( strtolower( substr( $test, -strlen( $ext ) ) ) === strtolower( $test_ext ) )
- {
- $cat[] = $test -> getPathname();
- break;
- }
- }
- $iterator -> next();
- }
- natcasesort( $cat );
- $cat = array_values( $cat );
- return $cat;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement