0

I have this simple session, and was trying to get it to display specific session variables to the screen. have not been able to find anything on the web that has been helpful

<?php 
session_start(); 

// makes an array 
$colors=array('red', 'yellow', 'blue'); 
// adds it to our session 
$_SESSION['color']=$colors; 
$_SESSION['size']='small'; 
$_SESSION['shape']='round'; 
print "Done";
?> 
4

1 回答 1

0

你有没有尝试过类似的东西

foreach($_SESSION as $key => $var) {
  echo "\$key = \$var<br>\n";
} 
于 2013-04-08T18:23:32.537 回答