Re: Remove value from array

From: Date: Wed, 16 Jan 2002 22:45:21 +0000
Subject: Re: Remove value from array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-80851@lists.php.net to get a copy of this message
This is a good one I just learned last week -- unset the variable. That is, unset($Arr[2]); or unset($Arr['cyanide']); from what I understand, the discovery of this easy way to do this was accidental. See the second annotation of "array_splice()" in the PHP manual here for the details: http://www.php.net/manual/en/function.array-splice.php On Wednesday, January 16, 2002, at 05:05 PM, phantom wrote:
$Str = apple,orange,cyanide,bananna $Arr = split(",",$Str); How do I remove the unwanted value from the array? (in this example, Cyanide ($Arr[2]) from the Fruit array)??? Thanks. array_splice()??? -- 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 (#80851) next »