By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,304 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,304 IT Pros & Developers. It's quick & easy.

array sort

P: n/a

How to sort an array without replacing the indices? I have an array
indexed by a timestamp and wish to sort based on that in numeric
ascending order.

thanks for any advice.
Feb 15 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Richard <rg****@gmail.comwrites:
How to sort an array without replacing the indices? I have an array
indexed by a timestamp and wish to sort based on that in numeric
ascending order.

thanks for any advice.
It's ok, more digging found what I wanted - ksort().
Feb 15 '07 #2

P: n/a
Richard kirjoitti:
How to sort an array without replacing the indices? I have an array
indexed by a timestamp and wish to sort based on that in numeric
ascending order.

thanks for any advice.
asort — Sort an array and maintain index association

Somewhere deep in the old caves of the web there's this mystical thing
called The Manual. It is said that those who approach The Manual seeking
the truth shall find the ancient myths of the Function Reference.

http://www.php.net

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Feb 15 '07 #3

P: n/a
Kimmo Laine <sp**@outolempi.netwrites:
Richard kirjoitti:
>How to sort an array without replacing the indices? I have an array
indexed by a timestamp and wish to sort based on that in numeric
ascending order.

thanks for any advice.

asort — Sort an array and maintain index association

Somewhere deep in the old caves of the web there's this mystical thing
called The Manual. It is said that those who approach The Manual
seeking the truth shall find the ancient myths of the Function
Reference.

http://www.php.net
Yes, a manual can be a great help.... But sometimes, these mystical
things are huge and take a lot of reading and, for a newbie to a
particular language, it can be hard to formulate the right search to
find something. It's why help groups exist - often to get people
started. It took me some time to find ksort which I indicated in a
followup post.
Feb 16 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.