ob_start(), dovresti richiamarla prima del tag html e ob_end_flush() dopo il tag html di chiusura.