Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- 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( substr( $test, -strlen( $ext ) ) === $test_ext )
- {
- $cat[] = $test;
- break;
- }
- }
- $iterator -> next();
- }
- return $cat;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement