title: PHP Setting a SESSION Variable Name Using A Variable
body: <p>I would like to set the name of a $_SESSION variable to be the value of another variable.
  e.g.</p>
  
  <pre><code>$var = "123";
  $_SESSION['$var'] = "yes";
  
  echo $_SESSION['123'];  // Would like to echo "yes"
  echo $_SESSION['$var'];  // Would also like to echo "yes"
  </code></pre>
  
  <p>I performed a vardump($_SESSION) and the session variable is literally set to "$_SESSION[$var]". How can I achieve the result I require?</p>
  
  <p>Many Thanks.</p>