php - Output Buffering or Re-arrange the code -


I am developing a small website using PHP, and during my research I saw many projects which < Before the code> ob_start page DOCTYPE is at the top of the page, because they need to redirect the middle page of the user in case of error (without "Header already sent" Error).

Now I am a bit confused because I never knew that ob_start can be used in this way (I mean, an entire page buffer), I always like this Write your code from:

   

And I have never had problems with the header, so what's better? Should I use ob_start instead of dividing the code?


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -