I wanted to know if the echoing the following would be a good alternative to using header(“Location: index.html”) without having to use output_buffering
There are times I would like to redirect possibly in a body, would the above work fine or is it worth turning on the output_buffering option and just user header()?
header() defines the page the user is viewing. Using output buffering forces to ignore the previous output buffer, so it is not considered an efficient way to redirect. So, here are my suggestions:
If your only target is to redirect, then make sure you output nothing before
headerstatement executes. In this case