Position actuelle: Accueil> Catégories de fonctions> fnmatch

fnmatch

Faire correspondre les noms de fichiers avec le modèle
Nom:fnmatch
Catégorie:Système de fichiers
Langage de programmation:php
Description en une ligne:Faites correspondre les noms de fichiers ou les chaînes en fonction du modèle spécifié.

Exemple

Vérifiez le nom de la couleur selon le wildcard Shell:

 <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">"Ma voiture est 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">écho</span> <span class="token string double-quoted-string">"une certaine forme de gris ..."</span> <span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
<span class="token delimiter important">?></span></span>
Fonctions similaires
Articles populaires