Checking a session variable in a PHP class

后端 未结 1 753
既然无缘
既然无缘 2021-01-23 16:15

At the top of my index page a set a session using:

$_SESSION[\'language\'] = \'english\';

and when I echo $_SESSION[\'language\'] it echoes \'e

相关标签:
1条回答
  • 2021-01-23 16:39

    You must call session_start() before you have access to the $_SESSION super global

    PHP session_start() docs

    0 讨论(0)
提交回复
热议问题