• PHP Video Tutorials

PHP - Function Header



Syntax

void header ( string $string [, bool $replace = true [, int $http_response_code ]] )

Definition and Usage

It is used to send the row of HTTP Headers.

Return Values

no value is returned

Parameters

Sr.No Parameters & Description
1

string

It contains header string.

2

replace

It replace parameter indicates whether the header should replace a previous similar header.

3

http_response_code

Http response code is the specific values, it indicates whether response is success or not.

Example

Try out following example

<?php
   header("Location: https://www.tutorialspoint.com/");
   
   exit;
?>

The above example redirect to the browser to tutorialspoint.com website

php_function_reference.htm
Advertisements