I need to be able to creat variable variable named sessions. So basically
$curdev = "device".$_SESSION['HTinfo']->numdevicesused;
ends up being "device1", "device2", etc. If i echo it, it displays the correct name
then I assign information to it with
$_SESSION[$curdev]->thing1=99; (ive also tried ($_SESSION[$$curdev]->thing1=99)
so this should in theory create $_SESSION[device1]->thing1=99
however when I try and access it as such
echo ($_SESSION['device1']->thing1);
or
echo ($_SESSION["device1"]->thing1);
or
echo ($_SESSION[device1]->thing1);
I get nothing. Ive been using session variables throughout this project and all other variables work fine. Can you not assign variable variable names for sessions? or any suggestions as to why this may not work
Variable Variable named sessions
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US