array sort

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard

    array sort


    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.
  • Richard

    #2
    Re: array sort

    Richard <rgrdev@gmail.c omwrites:
    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().

    Comment

    • Kimmo Laine

      #3
      Re: array sort

      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.

      PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


      --
      "En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
      spam@outolempi. net | Gedoon-S @ IRCnet | rot13(xvzzb@bhg byrzcv.arg)

      Comment

      • Richard

        #4
        Re: array sort

        Kimmo Laine <spam@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.

        Comment

        Working...