PHP connection_aborted() လုပ်ဆောင်ချက်
ဥပမာ
client သည် script ကိုပျက်သွားပါက log message ကိုရေးသည့် function (check_abort()) ကိုဖန်တီးပါ-
<?php
function check_abort()
{
if (connection_aborted())
error_log ("Script $GLOBALS[SCRIPT_NAME]" .
"$GLOBALS[SERVER_NAME] was aborted by the user.");
}
// Some script to be executed here
// Call the check_abort function when the script ends
register_shutdown_function("check_abort");
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
connection_aborted() လုပ်ဆောင်ချက်သည် သုံးစွဲသူသည် ချိတ်ဆက်မှုပြတ်တောက်ခြင်းရှိမရှိ စစ်ဆေးပေးသည်။
အထားအသို
connection_aborted()
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ချိတ်ဆက်မှုကို ဖျက်လိုက်လျှင် 1 ကို ပြန်ပေးသည်၊ သို့မဟုတ်ပါက ၎င်းသည် 0 သို့ ပြန်ပေးသည်။ |
---|---|
PHP ဗားရှင်း- | 4+ |
❮ PHP Misc အကိုးအကား