woolyg Posted December 19, 2007 Share Posted December 19, 2007 Hi all, another $_SESSION question from me - if I had <?php $number = "2"; ?> is it possible to set $_SESSION['account_$number'] = 'true' ... and would that effectively create $_SESSION['account_2'] = 'true' ?? Woolyg. Link to comment https://forums.phpfreaks.com/topic/82413-passing-variables-into-_session/ Share on other sites More sharing options...
papaface Posted December 19, 2007 Share Posted December 19, 2007 Yeah thats correct. If you want it boolean then you go: $_SESSION['account_$number'] = true; Link to comment https://forums.phpfreaks.com/topic/82413-passing-variables-into-_session/#findComment-418995 Share on other sites More sharing options...
corbin Posted December 19, 2007 Share Posted December 19, 2007 $_SESSION["account_{$number}"] = true; or $_SESSION['account_' . $number] = true; Link to comment https://forums.phpfreaks.com/topic/82413-passing-variables-into-_session/#findComment-419000 Share on other sites More sharing options...
papaface Posted December 19, 2007 Share Posted December 19, 2007 $_SESSION["account_{$number}"] = true; or $_SESSION['account_' . $number] = true; lol I didn't see that variable in the name of the session Link to comment https://forums.phpfreaks.com/topic/82413-passing-variables-into-_session/#findComment-419003 Share on other sites More sharing options...
corbin Posted December 19, 2007 Share Posted December 19, 2007 I didn't when I first read it.... Link to comment https://forums.phpfreaks.com/topic/82413-passing-variables-into-_session/#findComment-419004 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.