Jump to content


Photo

SESSION problem


  • Please log in to reply
2 replies to this topic

#1 eranwein

eranwein
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 14 March 2006 - 08:52 PM

i have an array stored in $_SESSION.
($_SESSION['some_array']).

how do i remove it from the session without using unset() for each of the array values?

#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 14 March 2006 - 10:23 PM

If you want to remove the $_SESSION['some_array'] totally, use

unset($_SESSION['some_array']);

If you want to set it to a blank array:

$_SESSION['some_array'] = array();

Set it to a blank string:

$_SESSION['some_array'] = "";

If you want to remove a single element of the array $_SESSION['some_array']:

unset($_SESSION['some_array']['some_value']);
or
$_SESSION['some_array']['some_value'] = "";


#3 eranwein

eranwein
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 15 March 2006 - 12:01 AM

thanks a lot




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users