note 94114 added to function.header

From: Date: Fri, 16 Oct 2009 23:42:10 +0000
Subject: note 94114 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-161822@lists.php.net to get a copy of this message
If you want to remove a header and keep it from being sent as part of the header response, just provide nothing as the header value after the header name. For example... PHP, by default, always returns the following header: "Content-Type: text/html" Which your entire header response will look like HTTP/1.1 200 OK Server: Apache/2.2.11 (Unix) X-Powered-By: PHP/5.2.8 Date: Fri, 16 Oct 2009 23:05:07 GMT Content-Type: text/html; charset=UTF-8 Connection: close If you call the header name with no value like so... <?php header( 'Content-Type:' ); ?> Your headers now look like this: HTTP/1.1 200 OK Server: Apache/2.2.11 (Unix) X-Powered-By: PHP/5.2.8 Date: Fri, 16 Oct 2009 23:05:07 GMT Connection: close ---- Server IP: 192.41.40.227 Probable Submitter: 207.93.111.254 ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- https://master.php.net/note/edit/94114 Del: integrated -- https://master.php.net/note/delete/94114/integrated Del: useless -- https://master.php.net/note/delete/94114/useless Del: bad code -- https://master.php.net/note/delete/94114/bad+code Del: spam -- https://master.php.net/note/delete/94114/spam Del: non-english -- https://master.php.net/note/delete/94114/non-english Del: in docs -- https://master.php.net/note/delete/94114/in+docs Del: other reasons-- https://master.php.net/note/delete/94114 Reject -- https://master.php.net/note/reject/94114 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#161822) next »