Re-sorting array indices numerically.
| From: | Martin Clifford | Date: | Mon, 17 Jun 2002 15:35:11 +0000 |
| Subject: | Re-sorting array indices numerically. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-102523@lists.php.net to get a copy of this message | ||
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