Example #1
0
/**
 * Indexes all the directories and subdirectories
 * contented in a given directory, and sort them alphabetically
 *
 * @param  - path (string) - directory path of the one to index
 * @return - an array containing the path of all the subdirectories sorted
 *           false, if there is no directory
 * @see    - index_and_sort_dir uses the index_dir() function
 */
function index_and_sort_dir($path)
{
    $dir_list = index_dir($path, 'DIR');
    if ($dir_list) {
        sort($dir_list);
        return $dir_list;
    } else {
        return false;
    }
}
/**
 * Indexes all the directories and subdirectories
 * contented in a given directory, and sort them alphabetically
 *
 * @author - Hugues Peeters <*****@*****.**>
 * @param  - path (string) - directory path of the one to index
 * @return - an array containing the path of all the subdirectories sorted
 *           false, if there is no directory
 * @see    - index_and_sort_dir uses the index_dir() function
 */
function index_and_sort_dir($path)
{
    $dir_list = index_dir($path);
    if ($dir_list) {
        natsort($dir_list);
        return $dir_list;
    }
    return false;
}