Don't use any of these! You should always use HTTP redirects.
Use ob_start()
to buffer content and avoid problem of headers already sent.
You might also try to write MVC application, where you would know whether you need to redirect before outputting anything (but with ob_start()
that is not necessary).