Session::add PHP Method

add() public static method

useful for collecting error messages etc
public static add ( mixed $key, mixed $value )
$key mixed
$value mixed
    public static function add($key, $value)
    {
        $_SESSION[$key][] = $value;
    }

Usage Example

Exemplo n.º 1
0
 public function indexAction()
 {
     $session = new Session();
     $session->add('name', 'php');
     $session->add('type', 'web');
     var_dump($_SESSION);
     $session->remove('name');
     var_dump($_SESSION);
     // 移去所有session变量
     $session->clear();
     // 移去存储在服务器端的数据
     $session->destroy();
     //        $session->close();
     var_dump($_SESSION);
 }
All Usage Examples Of Session::add