Funkce PHP flush() .
Příklad
Před dokončením běhu skriptu zadejte do prohlížeče řetězec:
<?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!";
?>
Definice a použití
Funkce flush()
požaduje, aby server odeslal svůj aktuálně uložený výstup do prohlížeče. Konfigurace serveru to nemusí vždy umožňovat.
Syntax
flush();
Technické údaje
Verze PHP: | 4+ |
---|
❮ Funkce řízení výstupu PHP