定义和用法fnmatch() 函数根据指定的模式来匹配文件名或字符串。 语法fnmatch(pattern,string,flags)
参数 | 描述 |
---|
pattern | 必需。规定要检索的模式。 | string | 必需。规定要检查的字符串或文件。 | flags | 可选。 |
提示和注释注释:该函数无法在 Windows 平台上使用。 实例根据 shell 通配符模式来检查颜色名: <?php$txt = "My car is darkgrey..."if (fnmatch("*gr[ae]y",$txt)) { echo "some form of gray ..."; }?>
下载地址: PHP flock() 函数 PHP fopen() 函数 |