PHP exit() လုပ်ဆောင်ချက်
ဥပမာ
မက်ဆေ့ချ်ကို ပရင့်ထုတ်ပြီး လက်ရှိ script ကို ထွက်ပါ-
<?php
$site = "https://www.w3schools.com/";
fopen($site,"r")
or exit("Unable to connect to $site");
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
exit() လုပ်ဆောင်ချက်သည် မက်ဆေ့ချ်တစ်ခုကို ပရင့်ထုတ်ပြီး လက်ရှိ script ကို အဆုံးသတ်သည်။
အထားအသို
exit(message)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
message | Required. A message or status number to print before terminating the script. A status number will not be written to the output, just used as the exit status. |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ဘာမှမဖြစ် |
---|---|
PHP ဗားရှင်း- | 4+ |
❮ PHP Misc အကိုးအကား