Re: Re-sorting array indices numerically.

From: Date: Mon, 17 Jun 2002 16:15:00 +0000
Subject: Re: Re-sorting array indices numerically.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-102536@lists.php.net to get a copy of this message
If you arn't bothered about the order of the items you could just use sort($array). Id imagine there's a better way though. Danny. ----- Original Message ----- From: "Martin Clifford" <MLC1@nrc.gov> To: <php-general@lists.php.net> Sent: Monday, June 17, 2002 4:35 PM Subject: [PHP] Re-sorting array indices numerically. Howdy all, I have finally been able to remove single elements from an array with the unset() function, and that works great. But now, if there are these items in the array: [0] Fruit [1] Eggs [2] Bacon After the unset() function does it's mojo to remove Eggs, the array is thus: [0] Fruit [2] Bacon My question is this: How do I resort the array so that after the unset() function goes through, the array would be this, having deleted Eggs: [0] Fruit [1] Bacon Thanks in advance! Please reply directly, as I'm on the digest. Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#102536) next »