Re: Array

From: Date: Thu, 15 Feb 2001 16:03:15 +0000
Subject: Re: Array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-39924@lists.php.net to get a copy of this message
Try this : <?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/en/function.array-slice.php http://www.php.net/manual/en/function.unset.php Regards, Philip Olson http://www.cornado.com/ On Thu, 15 Feb 2001, David Tandberg-Johansen wrote: > How can I delete one record in a array? > > Example: > > $myarray = array ("a", "b", "c"); > > I want to delete/take away "b" so the array is: > > $myarray = array ("a", "c"); > > David > > > > -- > 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 (#39924) next »