I would like to set the name of a $_SESSION variable to be the value of another variable. e.g.
$var = "123";
$_SESSION['$var'] = "yes";
echo $_SESSION['123']; // Would like to echo "yes"
echo $_SESSION['$var']; // Would also like to echo "yes"
I performed a vardump($_SESSION) and the session variable is literally set to "$_SESSION[$var]". How can I achieve the result I require?
Many Thanks.