PHP ob_start() လုပ်ဆောင်ချက်
❮ PHP အထွက်ထိန်းချုပ်မှုလုပ်ဆောင်ချက်များ
ဥပမာ
အထွက်ကြားခံတစ်ခု ဖန်တီးပါ-
<?php
ob_start();
echo "This content will not be sent to the
browser.";
ob_end_clean();
echo "This content will be sent to the
browser.";
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
လုပ်ဆောင်ချက်သည် အ ob_start()
ထွက်ကြားခံတစ်ခုကို ဖန်တီးပေးသည်။ ကြားခံမှ မဖယ်ရှားမီ ကြားခံ၏ အကြောင်းအရာများကို စီမံဆောင်ရွက်ပေးရန်အတွက် ပြန်လည်ခေါ်ဆိုမှုလုပ်ဆောင်ချက်ကို ပေးပို့နိုင်သည်။ ကြားခံလုပ်ဆောင်နိုင်သည့်အရာကို ခွင့်ပြုရန် သို့မဟုတ် ကန့်သတ်ရန် အလံများကို အသုံးပြုနိုင်သည်။
အထားအသို
ob_start(callback, chunk_size, flags);
ကန့်သတ်တန်ဖိုးများ
Parameter | Description | ||||||
---|---|---|---|---|---|---|---|
callback | Optional. A callback used to process the contents of the buffer before it gets flushed. The callback function should have the following parameters:
|
||||||
chunk_size | Optional. Defaults to 0. When set to a value greater than zero, the buffer will automatically be flushed as soon as the length of the contents exceeds this value | ||||||
flags | Optional. Defaults to PHP_OUTPUT_HANDLER_STDFLAGS. A bitmask which determines what operations the buffer is permitted to do. It may contain the following flags: PHP_OUTPUT_HANDLER_CLEANABLE - Calls to ob_clean(), ob_end_clean() and ob_get_clean() are permitted. PHP_OUTPUT_HANDLER_FLUSHABLE - Calls to ob_flush(), ob_end_flush() and ob_get_flush() are permitted. PHP_OUTPUT_HANDLER_REMOVABLE - Calls to ob_end_clean(), ob_end_flush() and ob_get_flush() are permitted. PHP_OUTPUT_HANDLER_STDFLAGS - Equivalent to PHP_OUTPUT_HANDLER_CLEANABLE| PHP_OUTPUT_HANDLER_FLUSHABLE| PHP_OUTPUT_HANDLER_REMOVABLE |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | အောင်မြင်မှုအပေါ် သစ္စာ၊ ကျရှုံးမှုတွင် မှားသည်။ |
---|---|
PHP ဗားရှင်း- | 4+ |
❮ PHP အထွက်ထိန်းချုပ်မှုလုပ်ဆောင်ချက်များ