Home > Backend Development > PHP Tutorial > 怎么只删除session中某个元素

怎么只删除session中某个元素

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 13:40:35
Original
1542 people have browsed it

如何只删除session中某个元素?
例如有:
session(0=>array(0=>'aa',1=>'bb'),1=>array(0=>'cc',1=>'dd'))
现在需要只删除aa,能否实现?

用unset不行,会把整个session destory掉

------解决方案--------------------
unset(session['username'])
------解决方案--------------------
session_start();
unset($_SESSION[0][0]);

Related labels:
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
Latest Issues
Session
From 1970-01-01 08:00:00
0
0
0
session
From 1970-01-01 08:00:00
0
0
0
session login information
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template