RE: [PHP] Remove value from array

From: Date: Mon, 25 Jun 2001 15:54:39 +0000
Subject: RE: [PHP] Remove value from array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-55153@lists.php.net to get a copy of this message
> > 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. > > As far as I know, this is not possible. You can, however, create a new > array > and copy all values except the deleted one from the old array, for example > with two array_slice() calls. http://php.net/manual/en/language.types.array.php there is written: "To change a certain value, just assign a new value to it. If you want to remove a key/value pair, you need to unset() it." michi -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- GMX Tipp: Machen Sie Ihr Hobby zu Geld bei unserem Partner 1&1! http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a

« previous php.general (#55153) next »