Re: How to unregister a single array item...

From: Date: Wed, 20 Nov 2002 21:25:47 +0000
Subject: Re: How to unregister a single array item...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-125331@lists.php.net to get a copy of this message
"@ Nilaab" <superbus22@attbi.com> wrote: > Hello, > How do I unregister a single array item from an array? For example: > > > session_start() > session_register("item"); > > $item['name'] = "Some Name"; > $item['img'] = "some_image_name.jpg"; > $item['desc'] = "Some Description"; > $item['price'] = 400; > --snip-- > > unset($item['desc']); > that will work just fine. think of it this way- the array $item is registered (and maybe unregistered) with the session, but its elements aren't individually registered with the array. just register/unregister the array, and otherwise work with the array by setting and unsetting the elements as you described.

« previous php.general (#125331) next »