require_once 'File/Find.php';
array &File_Find::glob (string $pattern, string $dirpath [, string $pattern_type = 'php'])
array &File_Find::glob
Search the directory to find matches for the specified pattern.
$pattern - a string containing the pattern to search the directory for.
$dirpath - a string containing the directory path to search.
$pattern_type - a string containing the type of pattern matching functions to use (can either be 'php', 'perl' or 'shell').
The format of the $pattern depends on the $pattern_type-value. For more information see search methods
array - an array contains all filenames and name of subdirectories, which matches the pattern. Or a PEAR_Error.
Table 38-1. Possible PEAR_Error values
This function can be called statically.
Example 38-1. Find all PHP files in current directory
include "File/Find.php"; $dir = "."; $items = &File_Find::glob( '!.*\.php$!', $dir, 'perl' ); print_r($items);