note 49357 rejected from ref.session by irchtml

From: Date: Wed, 02 Mar 2005 15:20:59 +0000
Subject: note 49357 rejected from ref.session by irchtml
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-85785@lists.php.net to get a copy of this message
Note Submitter: tom(AT)darlingpet.com ---- Just like some other array mentioned somewhere on the php.net site, if you try to use something like: <?php for($i=0;$i<9;$i++){ $_SESSION[$i] = ($i * $i) . " is a number"; } ?> it won't store the data... why?? it seems that an element key of an integer type just doesn't work.. my solution is to simply prepend a string at the beginning of the key. such as: <?php for($i=0;$i<9;$i++){ $_SESSION["i" . $i] = ($i * $i) . " is a number"; } ?> I think the $_COOKIE array does this too..... any ideas??

« previous php.notes (#85785) next »