男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站

fnmatch

(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)

fnmatch用模式匹配文件名

說(shuō)明

fnmatch(string $pattern, string $string, int $flags = 0): bool

fnmatch() 檢查傳入的 string 是否匹配給出的 shell 統配符 pattern。

參數

pattern

shell 統配符。

string

要檢查的字符串。 此函數對于文件名尤其有用,但也可以用于普通的字符串。

普通用戶(hù)可能習慣于 shell 模式或者至少其中最簡(jiǎn)單的形式 '?''*' 通配符,因此使用 fnmatch() 來(lái)代替 preg_match() 來(lái)進(jìn)行前端搜索表達式輸入對于非程序員用戶(hù)更加方便。

flags

The value of flags can be any combination of the following flags, joined with the binary OR (|) operator.

A list of possible flags for fnmatch()
Flag Description
FNM_NOESCAPE Disable backslash escaping.
FNM_PATHNAME Slash in string only matches slash in the given pattern.
FNM_PERIOD Leading period in string must be exactly matched by period in the given pattern.
FNM_CASEFOLD Caseless match. Part of the GNU extension.

返回值

匹配則返回 true,否則返回 false。

更新日志

版本 說(shuō)明
5.3.0 此函數開(kāi)始在 Windows 平臺上生效。

范例

示例 #1 用 shell 中的通配符模式匹配來(lái)檢查顏色名稱(chēng)

<?php
if (fnmatch("*gr[ae]y"$color)) {
  echo 
"some form of gray ...";
}
?>

注釋

警告

目前該函數無(wú)法在 Windows 或其它非 POSIX 兼容的系統上使用。

參見(jiàn)

男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站