project3 Posted March 31, 2008 Share Posted March 31, 2008 I need to see all the session names and variables. I don't know the names of the session or i know how to get them. I know you would use a foreach loop but I can't quite get it figured out. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted March 31, 2008 Share Posted March 31, 2008 <?php foreach ($_SESSION as $key => $val){ echo "$key - $val <br />"; } Quote Link to comment Share on other sites More sharing options...
project3 Posted March 31, 2008 Author Share Posted March 31, 2008 cool thanks. Quote Link to comment Share on other sites More sharing options...
redarrow Posted March 31, 2008 Share Posted March 31, 2008 try <?php foreach($_SESSION as $key=>$val){ echo "$key - $val <p></p>"; } ?> Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 31, 2008 Share Posted March 31, 2008 You can also do: <?php echo '<pre>' . print_r($_SESSION, true) . '</pre>'; ?> to see all of the session variables. Ken Quote Link to comment Share on other sites More sharing options...
redarrow Posted March 31, 2008 Share Posted March 31, 2008 ken code is so good and so obvious,dam im old. 10/10 ken...... You can also do: <?php echo '<pre>' . print_r($_SESSION, true) . '</pre>'; ?> to see all of the session variables. Ken Quote Link to comment 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.