note 54772 deleted from ref.session by bjori

From: Date: Mon, 11 Sep 2006 15:08:22 +0000
Subject: note 54772 deleted from ref.session by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-117020@lists.php.net to get a copy of this message
Note Submitter: jphansen at uga dot edu ---- If you name a variable the same name as a $_SESSION array and initialize it from a $_REQUEST variable, the $_SESSION array will assume that value, too. Example: <? $_SESSION["alphabet"] = array('a', 'b', 'c'); var_dump($_SESSION["alphabet"]); // array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" } $alphabet = $_REQUEST['bleh']; //null var_dump($_SESSION["alphabet"]); // NULL ?>

« previous php.notes (#117020) next »