English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Filesystem Reference Manual
The fnmatch() function matches a filename or string with the specified pattern.
bool fnmatch ( string $pattern , string $string [, int $flags = 0 ] )
The fnmatch() function can check if the passed string matches the given shell wildcard pattern, and this function has not yet been implemented on the Windows platform.
<?php $color = "phpcodez.txt"; if(fnmatch("*phpcode[zs].txt", $color)) { echo "phpcodez"; } else { echo "Color not found!"; } ?>
Output Result
phpcodez