How to Flush Out in PHP

The PHP buffer contains the output displayed on a page before the content renders in the user's browser. Flush the buffer using the "flush()" function. Flushing the buffer removes the content from the server memory and displays the page. This means you can display content as the PHP page is still processing. Flushing the buffer is typically used when you have a page that takes a while to run and you want to display a status to the user.

Instructions

    • 1

      Right-click the PHP page you want to edit. Click "Open With," then click the PHP editor in the list of programs.

    • 2

      Scroll down the page to where you want to flush the buffer. Flushing the buffer is typically used after you create a string that tells the user to wait for the form to finish processing. The following code shows you how to create a string for the buffer:

      echo "Please wait while the form processes.";

    • 3

      Flush the buffer. The following code flushes the PHP buffer:

      flush();

Related Searches:

References

Comments

Related Ads

Featured