PHP fnmatch() Fungsi
Referensi Sistem File PHPContoh
Memeriksa nama warna dengan pola wildcard shell:
<?php
$txt = "My car is a dark color";
if (fnmatch("*col[ou]r",$txt))
{
echo "hmm...";
}
?>
Definisi dan Penggunaan
Fungsi fnmatch() memeriksa apakah string atau nama file cocok dengan pola wildcard shell yang diberikan.
Sintaksis
fnmatch(pattern, string, flags)
Nilai Parameter
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:
|
Detail Teknis
Nilai Kembali: | BENAR pada keberhasilan, SALAH pada kegagalan |
---|---|
Versi PHP: | 4.3+ |
Log Perubahan PHP: | PHP 5.3: Sekarang tersedia di platform Windows |
Referensi Sistem File PHP