array( // [dir_FDE0] => 'dir_filespec0' , // [dir_FDE1] => 'dir_filespec1' , // [dir_FDE2] => 'dir_filespec2' , // ... ... // [dir_FDEn] => 'dir_filespecN' // ) // 'files' => array( // [file_FDE0] => 'file_filespec0' , // [file_FDE1] => 'file_filespec1' , // [file_FDE2] => 'file_filespec2' , // ... ... // [file_FDEn] => 'file_filespecN' // ) // 'other' => array( // [other_FDE0] => 'other_filespec0' , // [other_FDE1] => 'other_filespec1' , // [other_FDE2] => 'other_filespec2' , // ... ... // [other_FDEn] => 'other_filespecN' // ) // ) // // If directory is not a directory, then boolean FALSE is returned, // and an error of level E_WARNING is generated. // ----------------------------------------------------------------------- $dirs_and_files = super_scandir( $root_dir ) ; // ----------------------------------------------------------------------- if ( $dirs_and_files === FALSE ) { return << $this_dirspec ) { $result = load_directory_tree( $this_dirspec ) ; if ( is_string( $result ) ) { return $result ; } $tree['dirs'][ $this_dirspec ] = $result ; } // ------------------------------------------------------------------------- // FILES... // ------------------------------------------------------------------------- $tree['files'] = array_keys( $dirs_and_files['files'] ) ; // ------------------------------------------------------------------------- // OTHER... // ------------------------------------------------------------------------- $tree['other'] = array_values( $dirs_and_files['other'] ) ; // ========================================================================= // SUCCESS! // ========================================================================= return $tree ; // ========================================================================= // That's that! // ========================================================================= } // ============================================================================= // That's that! // =============================================================================