دالة تدفق PHP ()
مثال
إخراج سلسلة إلى المتصفح قبل انتهاء تشغيل البرنامج النصي:
<?php
// 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);
// Use flush() to send the string to the browser
flush();
// Display the rest of the content three seconds later
sleep(3);
echo "<br>";
echo "Hello World!";
?>
التعريف والاستخدام
تطلب flush()
الوظيفة من الخادم إرسال مخرجاته المخزنة حاليًا إلى المتصفح. قد لا يسمح تكوين الخادم بحدوث ذلك دائمًا.
بناء الجملة
flush();
تفاصيل تقنية
إصدار PHP: | 4+ |
---|
❮ وظائف التحكم في إخراج PHP