Home > Backend Development > PHP Tutorial > How to get the header information sent to the user in php_PHP tutorial

How to get the header information sent to the user in php_PHP tutorial

WBOY
Release: 2016-07-13 10:03:33
Original
1143 people have browsed it

How to obtain the header information sent to the user in php

This article mainly introduces the method of obtaining the header information sent to the user in php, involving the usage skills of the headers_list function in php , friends in need can refer to it

The example in this article describes how PHP obtains the header information sent to the user. Share it with everyone for your reference. The specific analysis is as follows:

The headers_list function has no parameters and returns an array. The returned array contains a numerical index table containing the header information to be sent to the client

?

1

2

3

4

5

6

7

8

9

10

header("Expires: Sat, 12 Dec 1989 05:30:00 GMT");

echo "This is some output.
";

echo "Headers sent are:

    ";

    $headers = headers_list();

    foreach($headers as $header) {

    echo "

  • $header
  • ";

    }

    echo "

";

?>

1 2

3

4 5

67 8 9 10
header("Expires: Sat, 12 Dec 1989 05:30:00 GMT"); echo "This is some output.
";
echo "Headers sent are:
    "; $headers = headers_list(); foreach($headers as $header) { echo "
  • $header
  • "; } echo "
"; ?>
I hope this article will be helpful to everyone’s PHP programming design. http://www.bkjia.com/PHPjc/968665.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/968665.htmlTechArticleHow to get the header information sent to the user by php. This article mainly introduces the method of php getting the header information sent to the user. The method involves the usage skills of the headers_list function in php, and requires friends...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template