Fnmatch
("= 4.3.0, PHP 5" in PHP 4)
Fnmatch-match a file name
Description
Boolean fnmatch (string $ mode, string $ string [Summary $ flag = 0])
Fnmatch () check, if the given Shell wildcard pattern will be matched by a string.
Parameters
Mode
In shell wildcard mode.
String
Test string. This feature is particularly useful for file names, but can also be used for common strings.
Generally, the user can use shell mode, or at least in its simplest form '? The 'and' * 'wildcards use fnmatch (), instead of the preg_match () frontend input search expression, which may be more convenient for non-programmed users.
Flag
A FNM_XXX constant.
Return value
Returns TRUE if there is a race, false in other ways.
Modify
Version description
5.3.0 is now available on Windows.
Instance
For example, #1 check the color name for a shell wildcard pattern
<? Php
If (fnmatch ("* gr [AE] y", $ color )){
Echo "some form of gray ...";
}
?>