richie_ropey Posted March 10, 2006 Share Posted March 10, 2006 Is there a way to select all the variables currently registerd in the $_SESSION variable? Quote Link to comment https://forums.phpfreaks.com/topic/4596-_session/ Share on other sites More sharing options...
txmedic03 Posted March 10, 2006 Share Posted March 10, 2006 Certainly, but what would you like to do with them?To process them one by one and write them out to the page.[code]<?phpwhile (list($key, $val)=each($_SESSION)) { echo "[".$key."]=>[".$val."]<br />";}?>[/code]If you want you can change that code around a bit or you a for each instead of the while, but the short and sweet just to see all the elements of the array and their values is [code]<?php print_r($_SESSION); ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/4596-_session/#findComment-16095 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.