Re: Proper way to remove an element from an array

From: Date: Tue, 10 Jul 2007 22:49:54 +0000
Subject: Re: Proper way to remove an element from an array
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-258580@lists.php.net to get a copy of this message
Thanks, this'll work. - Dan ""Eric Butera"" <eric.butera@gmail.com> wrote in message news:6a8639eb0707101425t72d0cfa7oc1f25985cc972e0e@mail.gmail.com...
On 7/10/07, Dan <frozendice@gmail.com> wrote:
I know in some languages there's a right way to remove an element from an array and other ways that will give you problems. In PHP can I just set $arrayname[key] = null? Or will I then end up with key => null as a value. I looked on php.net under array functions for a bit and I didn't find any sort of remove element function. I've just never needed to do this before. - Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
unset($arrayname[$key]) is fine.


« previous php.general (#258580) next »