note 47574 added to function.session-register

From: Date: Sun, 21 Nov 2004 09:40:22 +0000
Subject: note 47574 added to function.session-register
Groups: php.notes 
Request: Send a blank email to php-notes+get-80819@lists.php.net to get a copy of this message
I've noticed that if you try to assign a value to a session variable with a numeric name, the variable will not exist in future sessions. For example, if you do something like: session_start(); $_SESSION['14'] = "blah"; print_r($_SESSION); It'll display: Array ( [14] => "blah" ) But if on another page (with same session) you try session_start(); print_r($_SESSION); $_SESSION[14] will no longer exist. Maybe everyone else already knows this, but I didn't realize it until messing around with a broken script for quite a while. ---- Manual Page -- http://www.php.net/manual/en/function.session-register.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47574 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47574&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47574&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47574&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47574&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47574&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47574&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47574&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#80819) next »