php session 预定义数组

php下session的定义方法,注意了必须要用session_start()

  1. session_start();
  2. $_SESSION['username']="zhuzhao";
  3. ?>
  1. session_start();
  2. echo $_SESSION['username'];
  3. ?>