Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP fnmatch() Function

PHP fnmatch() Function


PHP Filesystem Reference Manual 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:


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual