Re: re-populate array keys
| From: | - Edwin | Date: | Mon, 24 Feb 2003 05:04:05 +0000 |
| Subject: | Re: re-populate array keys | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-136819@lists.php.net to get a copy of this message | ||
Hello,
Justin French <justin@indent.com.au> wrote:
> Hi, after asort()ing an array, the numeric keys are obviously
> out of order.
> what i'd like to do is reset the keys, starting at zero.
>
> is there a function for this, or do I just walk through the
> array with a foreach() and do it manually?
So, in other words, after sorting them, you'd like to "change"
the keys starting from zero?
In that case, I think you can use array_values() ...
- E
__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/