The code will continue to run - not only when the redirect takes longer, but each time from nd to the end.
If you use exit() , it depends on whether you want the rest of the code to execute. You can set header() and send a new address, but you can still perform some actions after that - for example, updating the database or some other bits.
I usually think that it is best to do all the necessary updates and send header() right at the end of the page - it makes debugging a lot easier and more intuitive.
source share