PHP is_readable() လုပ်ဆောင်ချက်
❮ PHP ဖိုင်စနစ် အကိုးအကားဥပမာ
သတ်မှတ်ထားသော ဖိုင်အမည်ကို ဖတ်နိုင်သလား စစ်ဆေးပါ-
<?php
$file = "test.txt";
if(is_readable($file)) {
echo ("$file is readable");
} else {
echo ("$file is not readable")
}
?>
အထက်ဖော်ပြပါ ကုဒ်၏ ရလဒ်သည်-
test.txt is readable
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
is_readable() လုပ်ဆောင်ချက်သည် သတ်မှတ်ထားသော ဖိုင်အမည်ကို ဖတ်နိုင်သည်ရှိမရှိ စစ်ဆေးပေးသည်။
မှတ်ချက်- ဤလုပ်ဆောင်ချက်၏ရလဒ်သည် ကက်ရှ်လုပ်ထားသည်။ cache ကိုရှင်းလင်းရန် clearstatcache() ကို သုံး ပါ။
အထားအသို
is_readable(file)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
file | Required. Specifies the path to the file to check |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ဖိုင်ကိုဖတ်နိုင်လျှင် FALSE နှင့် E_WARNING မဟုတ်ပါက TRUE |
---|---|
PHP ဗားရှင်း- | 4.0+ |
❮ PHP ဖိုင်စနစ် အကိုးအကား