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 The 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, the same header information can be enforced. |
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://ru.oldtoolbag.com/"); exit; ?>
The above example redirects the browser to the oldtoolbag.com website