RE: [PHP] $_SESSION
| From: | Ford, Mike [LSS] | Date: | Wed, 16 Oct 2002 11:17:52 +0000 |
| Subject: | RE: [PHP] $_SESSION | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-120164@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Paonarong Buachaiyo [mailto:pao@chiangmaicar.com]
> Sent: 16 October 2002 09:04
> To: php-general@lists.php.net
>
> Simple, how can we earse all $SESSION variable except one or
> two variables.
>
> Any way to do it except
>
> unset($_SESSION['xx1']);
> unset($_SESSION['xx2']);
> unset($_SESSION['xx3']);
> .
> unset($_SESSION['xx10']);
Well, one quick'n'dirty solution would be:
foreach (array('xx1', 'xx2', ..., 'xx10') as $x):
unset $_SESSION[$x];
endforeach;
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211