Definition :
The PHP fnmatch() function is used to check if a filename or string matches against a specified shell wildcard pattern. The function returns true if there is a match, false otherwise.
fnmatch(pattern, string, flags)
Parameter | Description |
---|---|
pattern | Required. Specifies the shell wildcard pattern |
string | Required. Specifies the string or file to check |
flags | Optional. Can be one or a combination of the following:
|
The example below shows the usage of fnmatch() function.
Output : Match found