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;
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. I have initalized the object, and can access the object manually(that code is not shown). Can you not assign variable variable names for sessions?
$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;
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. I have initalized the object, and can access the object manually(that code is not shown). Can you not assign variable variable names for sessions?