$_SESSION为什么不让打

WBOY
Release: 2016-06-23 14:39:13
Original
856 people have browsed it

我想打印出$_SEEION这个数组中的结构,但是返回的却是Notice:  Undefined variable: _SESSION in D:\wamp\www\test.php on line 3  记得以前打印$_SERVER很容易就出来,不知这个是为什么

<?php    echo '<pre class="brush:php;toolbar:false">';    print_r($_SESSION);    echo '
Copy after login
';?>


回复讨论(解决方案)

由于变量未定义引起的

请先session_start()

session 未开启

<?php    session_start();    echo '<pre class="brush:php;toolbar:false">';    print_r($_SESSION);    echo '
Copy after login
';?>

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!