What function do you use in PHP to start output buffering?

  • ob_start()
  • ob_flush()
  • ob_get_contents()
  • All of the above
In PHP, you can start output buffering using the ob_start() function. This function enables output buffering, capturing the output generated by PHP scripts and storing it in an internal buffer instead of immediately sending it to the client's browser. This provides the ability to manipulate the output, modify headers, and perform other operations before sending the final output to the browser. Using ob_start() is particularly useful when you need to conditionally modify or discard the output based on certain conditions or when you want to capture the output for further processing.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *