note 70178 added to function.unset
| From: | w dot PatrickGale at osu1 dot php dot net | Date: | Thu, 05 Oct 2006 20:37:01 +0000 |
| Subject: | note 70178 added to function.unset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-118102@lists.php.net to get a copy of this message | ||
If you aren't checking your variables using the 'isset' function, I would suggest not
using the unset function for removing values from global variables such as $_SESSION.
Save yourself the grief and just say:
<?php
$_SESSION = null; // to remove (set to null) everything for the session
// or
$_SESSION['somename'] = null; // to just remove individual session name values whether it
is an array or whatever
?>
----
Server IP: 216.194.113.175
Probable Submitter: 152.2.168.205
----
Manual Page -- http://www.php.net/manual/en/function.unset.php
Edit -- https://master.php.net/note/edit/70178
Del: integrated -- https://master.php.net/note/delete/70178/integrated
Del: useless -- https://master.php.net/note/delete/70178/useless
Del: bad code -- https://master.php.net/note/delete/70178/bad+code
Del: spam -- https://master.php.net/note/delete/70178/spam
Del: non-english -- https://master.php.net/note/delete/70178/non-english
Del: in docs -- https://master.php.net/note/delete/70178/in+docs
Del: other reasons-- https://master.php.net/note/delete/70178
Reject -- https://master.php.net/note/reject/70178
Search -- https://master.php.net/manage/user-notes.php