Quick Answer
Output buffering stores PHP output in memory instead of sending it directly to the browser. ob_start() starts buffering. ob_get_clean() returns the buffered content and clears it. Benefits: lets you set headers after output begins, manipulate output before sending, compress responses. Frameworks use it to wrap layout templates around content.
Answer
Output buffering stores output in a buffer so headers can be modified and output order can be controlled.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
PHP interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Ideal for freshers and experienced candidates preparing for PHP roles.