Re: unset()- newbie question

From: Date: Tue, 22 May 2001 14:15:10 +0000
Subject: Re: unset()- newbie question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-53855@lists.php.net to get a copy of this message
<? $array[ 'test' ] = "chris"; echo "before " . $array[ 'test' ] . "<br>"; unset( $array[ 'test' ] ); echo "after " . $array[ 'test' ]; ?> returns: before chris after hence, the unset function works fine for me. what version of php are you running? ""Tom"" <tom@fluidgraphix.com> wrote in message news:200105201300.AA6291916@fluidgraphix.com... > I can't seem to get unset() to work when I'm strying to delete an > element from an array. > > I have a select list that is populated by an array, and i need to > be able to delete items from the list by deleting them from the > array, but I don't know how. > > I tried using unset($array['element']); but it doesn't work. > Does anyone know why? > Does anyone know of a way to use array_diff() to delete elements > from an array? > > Thanks, > Tom > > > > > > > > -- > 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 (#53855) next »