If you're not explictly using the buffering functions, then ob_flush() is only necessary if output buffering is turned on in your php.ini file.
flush() is only necessary if implicit_flush is turned off in your php.ini file. Setting implicit_flush to on will remove the need for all these flush() calls, but it's generally only good in an extremely controlled environment. Turning on implicit_flush in a production environment can be bad.