Pjack125 Posted December 5, 2008 Share Posted December 5, 2008 I know this should be easy for most of you but I am having trouble figuring out how to display all the variables i collected across a multi-page form. what I am trying to get is the following output Variable Name = Value and i would like to have that loop until there isn't any more varible in the session. Quote Link to comment https://forums.phpfreaks.com/topic/135665-solved-displaying-all-the-data-colected-in-a-session/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 5, 2008 Share Posted December 5, 2008 Use a foreach() loop to iterate over all elements of an array (which is what $_SESSION is) - http://us2.php.net/foreach Quote Link to comment https://forums.phpfreaks.com/topic/135665-solved-displaying-all-the-data-colected-in-a-session/#findComment-706797 Share on other sites More sharing options...
Prismatic Posted December 5, 2008 Share Posted December 5, 2008 Use a foreach() loop to iterate over all elements of an array (which is what $_SESSION is) - http://us2.php.net/foreach <?php foreach($_SESSION as $key => $val) { echo $key ." => ". $val ."<br />"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/135665-solved-displaying-all-the-data-colected-in-a-session/#findComment-706803 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.