note 72975 added to function.unset
| From: | bjarne_andre at hotmail dot com | Date: | Tue, 06 Feb 2007 14:21:45 +0000 |
| Subject: | note 72975 added to function.unset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122925@lists.php.net to get a copy of this message | ||
On my website I use the following to create a sessionvar:
$_session["test"] = array(1,2,3,4,5);
If I try to delete it with:
unset($_session["test"]);
It now seems that $_session["test"] is deleted,
but if I do the following:
$_session["test"][1]=3;
$_session["test"] becomes [1,3,3,4,5]!
Any suggestions?
Is it a good aproach to set $_session["test"] = false ?
----
Server IP: 69.147.83.197
Probable Submitter: 129.241.206.134
----
Manual Page -- http://www.php.net/manual/en/function.unset.php
Edit -- https://master.php.net/note/edit/72975
Del: integrated -- https://master.php.net/note/delete/72975/integrated
Del: useless -- https://master.php.net/note/delete/72975/useless
Del: bad code -- https://master.php.net/note/delete/72975/bad+code
Del: spam -- https://master.php.net/note/delete/72975/spam
Del: non-english -- https://master.php.net/note/delete/72975/non-english
Del: in docs -- https://master.php.net/note/delete/72975/in+docs
Del: other reasons-- https://master.php.net/note/delete/72975
Reject -- https://master.php.net/note/reject/72975
Search -- https://master.php.net/manage/user-notes.php