The fnmatch() function matches a filename or string based on a specified pattern.
fnmatch(pattern,string,flags)
parameter | describe |
---|---|
pattern | Required. Specifies the pattern to search for. |
string | Required. Specifies a string or file to check. |
flags | Optional. |
Note: This function is not available on Windows platforms.
Check color names against shell wildcard patterns:
<?php$txt = "My car is darkgrey..."if (fnmatch("*gr[ae]y",$txt)) { echo "some form of gray..."; }?>