Http_redirect () vs header ()

Possible duplicate:
php vs php_redirect header location

Over the years, when I used PHP, I was always redirected to another URL through the header('Location: example.com') function header('Location: example.com') . http_redirect() today, I noticed that there is a function specifically for redirection called http_redirect()

Are there any advantages when using http_redirect() to header() or vice versa?


References:

+6
source share
1 answer

While http_redirect() does some things for you (such as exiting, flushing output buffers and sending a common redirect body), this is not a standard function (it comes as part of an extension that has not even been preloaded), and therefore you do not you can rely on availability.

+7
source

All Articles