• PHP Video Tutorials

PHP - Function Response Code



Syntax

int http_response_code ([ int $response_code ] )

Definition and Usage

It used to get or set the HTTP Response

Return Values

It Returns the response code, by default the return value is int(200).

Parameters

Sr.No Parameters & Description
1

response_code

The response code should be an integer.

Example

Try out following example

<?php
   var_dump(http_response_code());  
   http_response_code(404);
?>

The above code will set the response code as 404.

bool(false)
php_function_reference.htm
Advertisements