PHP fnmatch() Funksie
❮ PHP-lêerstelselverwysingVoorbeeld
Kontroleer 'n kleurnaam teen 'n dop-jokertekenpatroon:
<?php
$txt = "My car is a dark color";
if (fnmatch("*col[ou]r",$txt))
{
echo "hmm...";
}
?>
Definisie en gebruik
Die fnmatch()-funksie kyk of 'n string of lêernaam by die gegewe dop-wildertekenpatroon pas.
Sintaksis
fnmatch(pattern, string, flags)
Parameterwaardes
Parameter | Description |
---|---|
pattern | Required. Specifies the shell wildcard pattern |
string | Required. Specifies the string or file to check |
flags | Optional. Can be one or a combination of the following:
|
Tegniese besonderhede
Terugkeerwaarde: | WAAR oor sukses, ONWAAR oor mislukking |
---|---|
PHP weergawe: | 4,3+ |
PHP Changelog: | PHP 5.3: Nou beskikbaar op Windows-platforms |
❮ PHP-lêerstelselverwysing