PHP fnmatch() Function
Complete PHP Filesystem Reference Manual
Definition and Usage
The fnmatch() function matches a file name or string against a specified pattern.
Syntax
fnmatch(pattern,string,flags)
| Parameters | Description |
|---|---|
| pattern | Required. Specifies the pattern to match. |
| string | Required. Specifies the string or file to check. |
| flags | Optional. |
Tips and Notes
**Note:** This function cannot be used on Windows platforms.
Example
Check color names against a shell wildcard pattern:
Complete PHP Filesystem Reference Manual