PHP - Funktion ob_implicit_flush()
❮ PHP-Ausgabesteuerungsfunktionen
Beispiel
Senden Sie den Inhalt bei jeder Anweisung, die eine Ausgabe erzeugt, sofort an den Browser:
<?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);
?>
Definition und Verwendung
Die ob_implicit_flush()
Funktion aktiviert oder deaktiviert das implizite Spülen. Wenn diese Option aktiviert ist, sendet das implizite Leeren die Ausgabe direkt an den Browser, sobald sie erzeugt wird, sodass Aufrufe der flush()
Funktion nicht erforderlich sind.
Syntax
ob_implicit_flush(flag);
Parameterwerte
Parameter | Description |
---|---|
flag | When set to 1, implicit flushing is turned on. When set to 0, implicit flushing is turned off. |
Technische Details
PHP-Version: | 4+ |
---|
❮ PHP-Ausgabesteuerungsfunktionen