Justin French wrote:
been RTFMing for about 10 minutes, and can't find the function to re-key an array. In other words, I want an array of items to remain in their current order, but have the keys renumbered counting from zero.

yes, I know it can be done with a foreach, but I was hoping for something native :)

can anyone point me to the right page in the manual?

array_values()


$newarray = array_values($old_array);

Although this begs the question of why you'd need to "rekey" an array...

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to