What are some best practices for using the flush() function in PHP?

When using the flush() function in PHP, it is important to remember to also call ob_flush() to flush the output buffer before using flush(). This ensures that any buffered output is sent to the browser immediately. Additionally, it is recommended to use both functions in conjunction with ob_start() to start output buffering.

<?php
ob_start();
echo "Hello, World!";
ob_flush();
flush();
?>