وظيفة PHP fnmatch ()
❮ مرجع نظام ملفات PHPمثال
التحقق من اسم اللون مقابل نمط حرف بدل للقذيفة:
<?php
$txt = "My car is a dark color";
if (fnmatch("*col[ou]r",$txt))
{
echo "hmm...";
}
?>
التعريف والاستخدام
تتحقق الدالة fnmatch () مما إذا كانت السلسلة أو اسم الملف يطابق نمط حرف بدل shell المحدد.
بناء الجملة
fnmatch(pattern, string, flags)
قيمه المعامل
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:
|
تفاصيل تقنية
قيمة الإرجاع: | صواب في النجاح ، خطأ في الفشل |
---|---|
إصدار PHP: | 4.3+ |
سجل التغيير في PHP: | PHP 5.3: متوفر الآن على أنظمة تشغيل Windows |
❮ مرجع نظام ملفات PHP