Re: Remove value from array

From: Date: Tue, 26 Jun 2001 16:33:26 +0000
Subject: Re: Remove value from array
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-55203@lists.php.net to get a copy of this message
array_splice() is the best! thanks for the hint. "Philip Olson" <philip@cornado.com> wrote in message news:Pine.BSF.4.10.10106252001180.61091-100000@localhost... > Here's an example : > > <?php > > $foo = array('a','b','c'); > > unset($foo[1]); > > print_r($foo); // [0] => a [2] => c > > $bar = array('a','b','c'); > > $piece = array_splice ($bar, 1 ,1); > > print_r($piece); // [0] => b > > print_r($bar); // [0] => a [1] => c > > ?> > > http://www.php.net/manual/function.array-splice.php > > > regards, > philip > > > On Mon, 25 Jun 2001, Bret R. Zaun wrote: > > > Hello, > > how can I complete remove an item out of an array ? > > I tried unset() as well as setting the value to null. > > > > Both result in the value being null but not the item being deleted. > > > > Any help is appreciated > > Heiko > > > > > > > > -- > > 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 (#55203) next »