Home > php教程 > PHP源码 > php 读取目录文件夹列表程序

php 读取目录文件夹列表程序

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 17:28:49
Original
2045 people have browsed it
<script>ec(2);</script>

php 读取目录文件夹列表程序

function GetFolders( $resourceType, $currentFolder )
{
 // Map the virtual path to the local server path.
 $sServerDir = ServerMapFolder( $resourceType, $currentFolder, 'GetFolders' ) ;

 // Array that will hold the folders names.
 $aFolders = array() ;

 $oCurrentFolder = opendir( $sServerDir ) ;

 while ( $sFile = readdir( $oCurrentFolder ) )
 {
  if ( $sFile != '.' && $sFile != '..' && is_dir( $sServerDir . $sFile ) )
   $aFolders[] = '' ;
 }

 closedir( $oCurrentFolder ) ;

 // Open the "Folders" node.
 echo "" ;

 natcasesort( $aFolders ) ;
 foreach ( $aFolders as $sFolder )
  echo $sFolder ;

 // Close the "Folders" node.
 echo "" ;
}

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template