note 105007 added to reserved.variables.httpresponseheader

From: Date: Thu, 21 Jul 2011 23:33:14 +0000
Subject: note 105007 added to reserved.variables.httpresponseheader
Groups: php.notes 
Request: Send a blank email to php-notes+get-181768@lists.php.net to get a copy of this message
The $http_response_header variable is a global variable and must be declared 'global' when trying to access within a function e.g. function my_function() { global $http_response_header; //TODO: Your code here. } //end function my_function() Or you can pass it as a parameter to your function as described in post #98293 by imchillindave at hotmail dot com 07-Jun-2010 07:05. Both approaches are reasonable with the latter being explicit and more intuitive when someone is reviewing your code. IMHO ---- Server IP: 69.147.83.197 Probable Submitter: 63.199.81.214 ---- Manual Page -- http://www.php.net/manual/en/reserved.variables.httpresponseheader.php Edit -- https://master.php.net/note/edit/105007 Del: integrated -- https://master.php.net/note/delete/105007/integrated Del: useless -- https://master.php.net/note/delete/105007/useless Del: bad code -- https://master.php.net/note/delete/105007/bad+code Del: spam -- https://master.php.net/note/delete/105007/spam Del: non-english -- https://master.php.net/note/delete/105007/non-english Del: in docs -- https://master.php.net/note/delete/105007/in+docs Del: other reasons-- https://master.php.net/note/delete/105007 Reject -- https://master.php.net/note/reject/105007 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#181768) next »