php session

session_1.php

<?php

//
session_start();

$_SESSION['class_name'] = 'PHP34';
$_SESSION['teacher_name'] = 'Kang';

unset($_SESSION['teacher_name']);

$_SESSION['class_name'] = 'ITCAST-PHP34';

var_dump($_SESSION['class_name']);  //输出:string(12) "ITCAST-PHP34"

 

session_2.php

<?php
session_start();
echo $_SESSION['class_name'];//输出:ITCAST-PHP34

 

posted on 2017-07-02 16:54  huodaihao  阅读(128)  评论(0编辑  收藏  举报

导航