apgmxs_getDirectoryList

The Google Monthly XML Sitemap apgmxs getDirectoryList function.

Description

apgmxs_getDirectoryList( $directory ); 

Parameters (1)

0. $directory
The directory.

Usage

  1. if ( !function_exists( 'apgmxs_getDirectoryList' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-monthly-xml-sitemap/monthly-xml-sitemap.php'; 
  3.  
  4. // The directory. 
  5. $directory = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = apgmxs_getDirectoryList($directory); 
  9.  

Defined (1)

The function is defined in the following location(s).

/monthly-xml-sitemap.php  
  1. function apgmxs_getDirectoryList($directory) { 
  2. // create an array to hold directory list 
  3. $results = array(); 
  4. // create a handler for the directory 
  5. $handler = opendir($directory); 
  6. // open directory and walk through the filenames 
  7. while ($file = readdir($handler)) { 
  8. // if file isn't this directory or its parent, add it to the results 
  9. if ($file != "." && $file != "..") { 
  10. $results[] = $file; 
  11. // tidy up: close the handler 
  12. closedir($handler); 
  13. // done! 
  14. return $results;