PHP - GetFilesFolders($Path)





5
Date Submitted Wed. Sep. 20th, 2006 9:18 AM
Revision 1 of 1
Helper RaX
Tags PHP
Comments 0 comments
Returns an array of folder/file names in the specified path.

//------------------------------------------------------------------------------------------------------
//GetFilesFolders($Path)                                                                                                        FUNCTION
//------------------------------------------------------------------------------------------------------
//      What it does-
//                  Get's all file/folder names in $Path
//
//      Changes -
//            August 2nd, 2006 - RaX - Created.
//
//------------------------------------------------------------------------------------------------------
function GetFilesFolders($Path){
        $Index = 0;
        if ($handle = opendir($Path)){
                while(false !== ($file = readdir($handle))){
                        if($file != ".." && $file != "." && $file != 'index.php'){
                                $Result[$Index] = $file;
                        }
                        $Index++;
                }
        }
        return $Result;
}
 

Robert Ditthardt

Comments

There are currently no comments for this snippet.

Voting