PHP ob_implicit_flush()ฟังก์ชัน
❮ ฟังก์ชั่นการควบคุมเอาต์พุต PHP
ตัวอย่าง
ส่งเนื้อหาไปยังเบราว์เซอร์ทันทีในทุกคำสั่งที่สร้างผลลัพธ์:
<?php
// Turn on implicit flushing
ob_implicit_flush(1);
// Some
browsers will not display the content if it is too short
// We use
str_pad() to make the output long enough
echo str_pad("Hello World!",
4096);
// Even though the script is still running, the browser already
can
see the content
sleep(3);
?>
ความหมายและการใช้งาน
ฟังก์ชัน นี้ob_implicit_flush()
เปิดหรือปิดใช้งานการล้างข้อมูลโดยปริยาย เมื่อเปิดใช้งาน การล้างข้อมูลโดยนัยจะส่งเอาต์พุตไปยังเบราว์เซอร์โดยตรงทันทีที่มีการสร้าง เพื่อไม่ให้มีการเรียกใช้flush()
ฟังก์ชัน
ไวยากรณ์
ob_implicit_flush(flag);
ค่าพารามิเตอร์
Parameter | Description |
---|---|
flag | When set to 1, implicit flushing is turned on. When set to 0, implicit flushing is turned off. |
รายละเอียดทางเทคนิค
รุ่น PHP: | 4+ |
---|
❮ ฟังก์ชั่นการควบคุมเอาต์พุต PHP