English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The header() function sends native HTTP headers
void header (string $string[, bool $replace = true[, int $http_response_code]])
It is used to send HTTP header lines.
No value returned
Serial number | Parameters and descriptions |
---|---|
1 | string Header string. |
2 | repalce Optional parameter replace indicates whether the header behind it replaces the previous header of the same type. By default, it will replace. If FALSE is passed, it can force the same header information to coexist. |
3 | http_response_code Forces the specified HTTP response value. Note that this parameter is only effective when the message string is not empty. |
Try the following example
<?php header("Location: https:")//www.oldtoolbag.com/"); exit; ?>
The example above redirects the browser to oldtoolbag.com website