note 66117 added to language.functions

From: Date: Mon, 15 May 2006 08:23:29 +0000
Subject: note 66117 added to language.functions
Groups: php.notes 
Request: Send a blank email to php-notes+get-111302@lists.php.net to get a copy of this message
If you use cookies in a function use: function fred() { global $HTTP_COOKIE_VARS; list($var1, $var2) = explode(":",$HTTP_COOKIE_VARS[person]); } or function fred() { list($var1, $var2) = explode(":",$_COOKIE[person]); } $_COOKIE from PHP 4.1.0 onwards is autoglobal so does not need to be listed as a global in a function. $HTTP_COOKIE_VARS is not autoglobal and must be listed as a global in a function or its values will not be available to the function to process and come back blank all the time! $_COOKIE is heaps easier to use if you have PHP 4.1.0 or above. ---- Server IP: 66.163.161.117 Probable Submitter: 202.173.128.90 (proxied: 220.235.220.247) ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/language.functions.php Edit -- http://master.php.net/note/edit/66117 Del: integrated -- http://master.php.net/note/delete/66117/integrated Del: useless -- http://master.php.net/note/delete/66117/useless Del: bad code -- http://master.php.net/note/delete/66117/bad+code Del: spam -- http://master.php.net/note/delete/66117/spam Del: non-english -- http://master.php.net/note/delete/66117/non-english Del: in docs -- http://master.php.net/note/delete/66117/in+docs Del: other reasons-- http://master.php.net/note/delete/66117 Reject -- http://master.php.net/note/reject/66117 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#111302) next »