PHP flush() Fungsi
Contoh
Keluarkan string ke browser sebelum skrip selesai dijalankan:
<?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!";
?>
Definisi dan Penggunaan
Fungsi flush()
tersebut meminta server untuk mengirimkan output yang saat ini di-buffer ke browser. Konfigurasi server mungkin tidak selalu memungkinkan hal ini terjadi.
Sintaksis
flush();
Detail Teknis
Versi PHP: | 4+ |
---|
Fungsi Kontrol Output PHP