Re: unregister part of array in session

From: Date: Mon, 16 Apr 2001 12:05:36 +0000
Subject: Re: unregister part of array in session
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-48736@lists.php.net to get a copy of this message
I did it! Too much work for something as simple as this though IMO. I think I will write a function for this... <? session_start(); $newarray = $HTTP_SESSION_VARS["array"]; unset ($newarray["one"]); $array = $newarray; session_register("array"); ?> Thanks, // Tobias ""Yasuo Ohgaki"" <yohgaki@hotmail.com> wrote in message news:9bdeag$88r$1@toye.p.sourceforge.net... > You are registered $array as session, > You need to unset() element. I think it should work. > > Regards, > -- > Yasuo Ohgaki > > > ""Tobias Talltorp"" <tobias@talltorp.com> wrote in message > news:9bd8un$kqt$1@toye.p.sourceforge.net... > > I know how to unset a specific value in an ordinary array: > > unset ($array["one"]); > > How do I do this if my array is in a session? > > > > Here is my code: > > <? > > session_start(); > > $array = array(one=> "number one", two=> "Number two", > > three=> "Number > > three"); > > session_register("array"); > > ?> > > > > I tried this... Didn't work: > > <? > > session_start(); > > session_unregister("array[one]"); > > ?> > > > > Thanks, > > // Tobias Talltorp > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#48736) next »