PHP dirname() လုပ်ဆောင်ချက်
❮ PHP ဖိုင်စနစ် အကိုးအကားဥပမာ
ပင်မလမ်းညွှန်၏လမ်းကြောင်းကို ပြန်ပေးပါ။
<?php
echo dirname("c:/testweb/home.php") . "<br />";
echo dirname("c:/testweb/home.php",
2) . "<br />";
echo dirname("/testweb/home.php");
?>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
c:/testweb
c:
/testweb
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
dirname() လုပ်ဆောင်ချက်သည် parent directory ၏လမ်းကြောင်းကို ပြန်ပေးသည်။
အထားအသို
dirname(path, levels)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
path | Required. Specifies a path to check |
levels | Optional. An integer that specifies the number of parent directories to go up. Default is 1 |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | အောင်မြင်မှုအပေါ် မိဘလမ်းညွှန်၏ လမ်းကြောင်း |
---|---|
PHP ဗားရှင်း- | 4.0+ |
Binary Safe- | ဟုတ်တယ်၊ PHP 5.0 မှာ |
PHP Changelog- | PHP 7.0 - အဆင့် သတ်မှတ်ချက်များ ကို ထည့်သွင်းထားသည်။ |
❮ PHP ဖိုင်စနစ် အကိုးအကား