怎么只删除session中某个元素

WBOY
Release: 2016-06-13 10:07:58
Original
1026 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:
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!