Page 1 of 1

removing an array elements...

Posted: Tue Oct 29, 2002 7:11 pm
by matthiasone
is there an easy way to removing an array element from an 3-demisional array?
I have an array:

Code: Select all

$currentї'group']ї1]ї'item1']
$currentї'group']ї1]ї'item2']
$currentї'group']ї1]ї'item3']
$currentї'group']ї2]ї'item1']
$currentї'group']ї2]ї'item2']
$currentї'group']ї2]ї'item3']
$currentї'group']ї3]ї'item1']
$currentї'group']ї3]ї'item2']
$currentї'group']ї3]ї'item3']
Now I want to remove

Code: Select all

$currentїgroup']ї2]
What is the easiest way?

Matt 8O

Posted: Tue Oct 29, 2002 7:47 pm
by hob_goblin

Code: Select all

unset($currentїgroup']ї2]);

Posted: Wed Oct 30, 2002 1:52 pm
by matthiasone
does that apply to $_Session?

Posted: Thu Oct 31, 2002 2:32 am
by twigletmac
Yes you can do

Code: Select all

unset($_SESSIONї'var'])
to unset a session variable. If you want to get rid of a session altogether though you need to use session_destroy().

Mac