Possible Duplicate:
php header location vs php_redirect
Throughout the years I've been using PHP I've always redirected to another URL via the header('Location: example.com')
function. Today while browsing php.net I've noticed there is a function specifically for redirection called http_redirect()
Are there any benefits to using http_redirect()
to header()
or vice versa?
References:
While http_redirect()
does some things for you (such as exit, clear output buffers and sends a generic redirection body), it is not a standard function (it comes as part of an extension that's not even a pre-loaded one) and therefore you can't really rely on it being available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With