File_Find::search()

File_Find::search() – find matches for a pattern in a directory

Synopsis

require_once 'File/Find.php';

array &File_Find::search ( string $pattern , string $dirpath , string $pattern_type = 'php' , bool $fullpath = true , string $match = 'files' )

Description

Search the directory to find matches for the specified pattern.

Parameter

  • $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

  • $fullpath - whether the string should be matched against the full path or only against the filename

  • $match - can be either 'files', 'directories' or 'both' to specify the kind of list to return

Return value

array - an array containing all filenames

Note

This function can be called statically.

create a recursive view map for a directory (Previous) File_SMBPasswd (Next)
Last updated: Thu, 02 Oct 2014 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.