PHP closedir() လုပ်ဆောင်ချက်
ဥပမာ
လမ်းညွှန်တစ်ခုကိုဖွင့်ပါ၊ ၎င်း၏အကြောင်းအရာများကိုဖတ်ပါ၊ ထို့နောက်ပိတ်ပါ-
<?php
$dir = "/images/";
// Open a directory, and read its contents
if (is_dir($dir)){
if ($dh = opendir($dir)){
while (($file = readdir($dh)) !== false){
echo "filename:" . $file . "<br>";
}
closedir($dh);
}
}
?>
ရလဒ်:
filename: cat.gif
filename: dog.gif
filename: horse.gif
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
closedir() လုပ်ဆောင်ချက်သည် လမ်းညွှန်လက်ကိုင်ကို ပိတ်သည်။
အထားအသို
closedir(dir)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
dir | Optional. Specifies the directory handle resource previously opened with opendir(). If this parameter is not specified, the last link opened by opendir() is assumed |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | - |
---|---|
PHP ဗားရှင်း- | 4.0+ |
❮ PHP လမ်းညွှန်အကိုးအကား