PHP fnmatch May 11, 2012 Pramod T P Match filename against a pattern Example <?php $color =”phpcodez.txt”; if (fnmatch(“*phpcode[zs].txt”, $color)) { echo “phpcodez”; } ?> Output phpcodez