PHP fnmatch() Function

The fnmatch() function matches a filename or string against the specified pattern.

bool fnmatch ( string $pattern , string $string [, int $flags = 0 ] )

fnmatch() checks if the passed string would match the given shell wildcard pattern.

Example -

ParameterDescription
patternRequired. Specifies the pattern to search for
stringRequired. Specifies the string or file check
flagsOptional.

Note

This function is not implemented on Windows platforms.