Name

fnmatch

Synopsis

int fnmatch(string pattern, string string[, int flags])

Returns true if string matches the shell wildcard pattern given in pattern. See glob for the pattern matching rules. The flags value is a bitwise OR of any of the following values:

FNM_NOESCAPE

Treat backslashes in pattern as backslashes, rather than as the start of an escape sequence.

FNM_PATHNAME

Slash characters in string must be matched explicitly by slashes in pattern.

FNM_PERIOD

A period at the beginning of the string, or before any slash if FNM_PATHNAME is also specified must be explicitly matched by periods in pattern.

FNM_LEADING_DIR

Ignore anything after a “/*” if the pattern matches up to that point.

FNM_CASEFOLD

Ignore case when matching string to pattern.

Get Programming PHP, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.