現在の位置: ホーム> 関数カテゴリ一覧> fnmatch

fnmatch

パターンでファイル名を一致させます
名前:fnmatch
カテゴリ:ファイルシステム
対応言語:php
一言説明:指定されたパターンに従ってファイル名または文字列を一致させます。

シェルワイルドカードに従ってカラー名を確認してください。

 <span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token variable">$ txt</span> <span class="token operator">=</span> <span class="token string double-quoted-string">"私の車はdarkgreyです..."</span>
<span class="token keyword">if</span> <span class="token punctuation">(</span> <span class="token function">fnmatch</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"*gr [ae] y"</span> <span class="token punctuation">、</span> <span class="token variable">$ txt</span> <span class="token punctuation">)</span> <span class="token punctuation">)</span>
  <span class="token punctuation">{</span>
  <span class="token keyword">エコー</span><span class="token string double-quoted-string">「何らかの形の灰色...」</span> <span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
<span class="token delimiter important">?></span></span>
類似の関数
  • 一時ファイルを作成します tmpfile

    tmpfile

    一時ファイルを作成します
  • パスのファイル名パーツを返します basename

    basename

    パスのファイル名パーツを返します
  • ファイル所有者を変更します chown

    chown

    ファイル所有者を変更します
  • ファイルの所有者を取得します fileowner

    fileowner

    ファイルの所有者を取得します
  • 出力ファイルポインターに残っているすべてのデータ fpassthru

    fpassthru

    出力ファイルポインターに残っているすべて
  • ファイルからのフォーマット入力 fscanf

    fscanf

    ファイルからのフォーマット入力
  • 実際のパスバッファーのサイズを取得します realpath_cache_size

    realpath_cache_size

    実際のパスバッファーのサイズを取得します
  • パスのディレクトリパーツに戻ります dirname

    dirname

    パスのディレクトリパーツに戻ります
人気記事(にんききじ)