How to print all session variables currently set?

后端 未结 7 2041
眼角桃花
眼角桃花 2020-12-12 18:56

Without having to call each session variable by name, is there a way to display the content of all the session variables currently set?

相关标签:
7条回答
  • 2020-12-12 19:35
    echo '<pre>';
    var_dump($_SESSION);
    echo '</pre>';
    

    Or you can use print_r if you don't care about types. If you use print_r, you can make the second argument TRUE so it will return instead of echo, useful for...

    echo '<pre>' . print_r($_SESSION, TRUE) . '</pre>';
    
    0 讨论(0)
提交回复
热议问题