PHP clearstatcache() လုပ်ဆောင်ချက်
❮ PHP ဖိုင်စနစ် အကိုးအကားဥပမာ
ဖိုင်အရွယ်အစား၊ ဖိုင်ကိုဖြတ်ထုတ်ပါ၊ ကက်ရှ်ကိုရှင်းလင်းပြီးနောက် ဖိုင်အရွယ်အစားကို ထပ်မံထုတ်ပေးပါ-
<?php
//output filesize
echo filesize("test.txt");
echo "<br />";
$file = fopen("test.txt", "a+");
// truncate file
ftruncate($file,100);
fclose($file);
//Clear cache and check filesize again
clearstatcache();
echo filesize("test.txt");
?>
အထက်ဖော်ပြပါ ကုဒ်၏ ရလဒ်သည်-
792
100
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
clearstatcache() လုပ်ဆောင်ချက်သည် ဖိုင်အခြေအနေ ကက်ရှ်ကို ရှင်းလင်းစေသည်။
PHP သည် အချို့သော လုပ်ဆောင်ချက်များအတွက် ဒေတာများကို သိမ်းဆည်းပေးပါသည်။ ဖိုင်တစ်ခုကို script တစ်ခုတွင် အကြိမ်ပေါင်းများစွာ စစ်ဆေးရပါက၊ မှန်ကန်သောရလဒ်များရရှိရန် ကက်ချခြင်းကို ရှောင်ရှားလိုပေမည်။ ဒါကိုလုပ်ဖို့ clearstatcache() function ကိုသုံးပါ။
အထားအသို
clearstatcache(clear_realpath_cache, filename)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
clear_realpath_cache | Optional. Indicates whether to clear the realpath cache or not. Default is FALSE, which indicates not to clear realpath cache |
filename | Optional. Specifies a filename, and clears the realpath and cache for that file only |
အကြံပြုချက်များနှင့် မှတ်စုများ
အကြံပြုချက်- ကက်ရှ်လုပ်နေသော လုပ်ဆောင်ချက်များ-
- stat()
- lstat()
- file_exists()
- is_writable()
- is_readable()
- is_executable()
- is_file()
- is_dir()
- is_link()
- filectime()
- fileatime ()
- filemtime()
- fileinode()
- ဖိုင်အဖွဲ့()
- ဖိုင်ပိုင်ရှင်()
- ဖိုင်အရွယ်အစား()
- ဖိုင်အမျိုးအစား()
- fileperms()
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ဘာမှမဖြစ် |
---|---|
PHP ဗားရှင်း- | 4.0+ |
PHP Changelog- | PHP 5.3 - ရွေးချယ်နိုင်သော ကန့်သတ်ဘောင်နှစ်ခုကို ထည့်ထားသည်- clear_realpath_cahe နှင့် ဖိုင်အမည် |
❮ PHP ဖိုင်စနစ် အကိုးအကား