fnmatch

Match filename against a pattern

Example

<?php

$color =”phpcodez.txt”;

if (fnmatch(“*phpcode[zs].txt”, $color)) {

 echo “phpcodez”;

}

?>

Output

phpcodez