Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

http_response_header(3) [php man page]

HTTP_RESPONSE_HEADER(3) 						 1						   HTTP_RESPONSE_HEADER(3)

$http_response_header - HTTP response headers

	The $http_response_header array is similar to the get_headers(3) function. When using the HTTP wrapper, $http_response_header will be pop-
       ulated with the HTTP response headers. $http_response_header will be created in the local scope.

       Example #1

	      $http_response_header example

	      <?php
	      function get_contents() {
		file_get_contents("http://example.com");
		var_dump($http_response_header);
	      }
	      get_contents();
	      var_dump($http_response_header);
	      ?>

	      The above example will output something similar to:

	      array(9) {
		[0]=>
		string(15) "HTTP/1.1 200 OK"
		[1]=>
		string(35) "Date: Sat, 12 Apr 2008 17:30:38 GMT"
		[2]=>
		string(29) "Server: Apache/2.2.3 (CentOS)"
		[3]=>
		string(44) "Last-Modified: Tue, 15 Nov 2005 13:24:10 GMT"
		[4]=>
		string(27) "ETag: "280100-1b6-80bfd280""
		[5]=>
		string(20) "Accept-Ranges: bytes"
		[6]=>
		string(19) "Content-Length: 438"
		[7]=>
		string(17) "Connection: close"
		[8]=>
		string(38) "Content-Type: text/html; charset=UTF-8"
	      }
	      NULL

PHP Documentation Group 												   HTTP_RESPONSE_HEADER(3)

Check Out this Related Man Page

HTTP_PARSE_MESSAGE(3)							 1						     HTTP_PARSE_MESSAGE(3)

http_parse_message - Parse HTTP messages

SYNOPSIS
object http_parse_message (string $message) DESCRIPTION
Parses the HTTP $message into a simple recursive object. PARAMETERS
o $message - string containing a single HTTP message or several consecutive HTTP messages RETURN VALUES
Returns a hierarchical object structure of the parsed messages. EXAMPLES
Example #1 Using http_parse_message(3) <?php define ('URL', 'http://www.example.com/'); print_r(http_parse_message(http_get(URL, array('redirect' => 3)))); ?> The above example will output something similar to: stdClass object ( [type] => 2 [httpVersion] => 1.1 [responseCode] => 200 [headers] => Array ( [Content-Length] => 3 [Server] => Apache ) [body] => Hi! [parentMessage] => stdClass object ( [type] => 2 [httpVersion] => 1.1 [responseCode] => 302 [headers] => Array ( [Content-Length] => 0 [Location] => ... ) [body] => [parentMessage] => ... ) ) SEE ALSO
http_parse_headers(3), the HttpMessage class. PHP Documentation Group HTTP_PARSE_MESSAGE(3)
Man Page

12 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

count characters in specific records

I have a text file which represents a http flow like this: HTTP/1.1 200 OK Date: Fri, 23 Jan 2009 17:16:24 GMT Server: Apache Last-Modified: Fri, 23 Jan 2009 17:08:03 GMT Accept-Ranges: bytes Cache-Control: max-age=540 Expires: Fri, 23 Jan 2009 17:21:31 GMT Vary: Accept-Encoding ... (1 Reply)
Discussion started by: littleboyblu
1 Replies

2. Linux

CentOS on Super Computers

Hi all, This is a good news for CentOS fans , It seems that CentOS found its way to Super Computers for details (1 Reply)
Discussion started by: h@foorsa.biz
1 Replies

3. Red Hat

phpmyadmin in CentOS

My friend need install phpmyadmin in CentOS but he don't know how. Some1 cen help:confused: (2 Replies)
Discussion started by: RedLay
2 Replies

4. UNIX for Dummies Questions & Answers

Grep and Awk

Hi Friends, I have the below text in a file outbound.tmp HTTP/1.1 200 OK Date: Tue, 22 Jun 2010 19:34:09 GMT RC: 0 Content-Type: text/html Content-Length: 0 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive I need to extract the value next to the word - RC. Example: RC: 0 ... (8 Replies)
Discussion started by: diva_thilak
8 Replies

5. Virtualization and Cloud Computing

Installing CentOS 5.5 on Virtual Box

Hi, I have installed VirtualBox, downloaded CentOS 5.5 and created a VirtualMachine where i have installed the 'server' versión of CentOS 5.5 As I installed Virtual Box a new network device appeared '192.16.1.250' in my 'real' machine. I was unable to reach my webserver so i istalled CentOS once... (5 Replies)
Discussion started by: motoko
5 Replies

6. Shell Programming and Scripting

Bash Script to Find the status of URL

#!/bin/bash timevar=`date +%d-%m-%Y_%H.%M.%S` #-- > Storing Date and Time in a Variable get_contents=`cat urls.txt` #-- > Getting content of website from file. Note the file should not contain any http:// as its already been taken care of echo "Datae-time URL Status code Report" >... (2 Replies)
Discussion started by: anishkumarv
2 Replies

7. AIX

Server Power7 p750 support CentOS or not ?

Hi All, I would like to install CentOS 5.5 linux on Power7 server (P750). it support or not?? I found information from IBM websites as detail below, but not sure for CentOS. IBM Power 750 support linux >>Red Hat Enterprise Linux 5.5, SUSE Linux Enterprise Server 10 SP3,... (2 Replies)
Discussion started by: arm_naja
2 Replies

8. Linux

CentOS Error: Superblock

Hi Guys, I really don't know where to put my query about this. And as a newbie, I think CentOS is closest to Ubuntu. Anyway, here's my dilemma. I have installed a VMWare - ESX 3.5 and installed CentOS 6 and cloned the CentOS 6. The first CentOS was working fine, when i cloned it, and the cloning... (2 Replies)
Discussion started by: init6_
2 Replies

9. Shell Programming and Scripting

How to check string encoding?

I want to check if the string is WINDOWS-1251 or UTF-8 can you help me to find the string encoding??? or maybe to get URL Content-Type charset with wget? this is my function on PHP function check_utf8($str) { $len = strlen($str); for($i = 0; $i < $len; $i++){ $c =... (2 Replies)
Discussion started by: sanantonio7777
2 Replies

10. UNIX for Dummies Questions & Answers

why output consists of 3 values

Hi there if I have a file called an411 which contains the folowing information 152.78.74.111 "GET /datafeed.php HTTP/1.1" 200 2826 152.78.74.211 "GET /index.html HTTP/1.1" 200 1190 152.78.74.121 "GET / HTTP/1.1" 200 3000 and I want to ouput the number of bytes of the record that contains... (2 Replies)
Discussion started by: FUTURE_EINSTEIN
2 Replies

11. Red Hat

CentOS Upgrade from 6.4 to 6.5 no updates

I did an upgrade on Jan 3,2014 from CentOS 6.4 to 6.5 and noticed that there hasnt been any updates since then Jan 03 11:45:05 Updated: 12:dhcp-common-4.1.1-38.P1.el6.centos.i686 Jan 03 11:45:06 Updated: hwdata-0.233-9.1.el6.noarch Jan 03 11:45:11 Updated:... (4 Replies)
Discussion started by: metallica1973
4 Replies

12. Shell Programming and Scripting

SQL Injection Detection

I want to grep/awk /var/log/httpd/mysite-access_log.log and check if 2 words from the following appear in a single line: benchmark union information_schema drop truncate group_concat into file case hex lpad group order having insert union select from (12 Replies)
Discussion started by: koutroul
12 Replies