• sorting arrays

      1 comment

    Both sort() and asort() is used to sort values in ascending order.To sort them in descending order what are the functions that we can use?

    rsort() – Where it resets key associations as well.
    arsort() – Where it sorts in descending order, while keeping the key associations as well.

  • Array sorting

      0 comments

    What is the difference between sort() and asort()?

    The main difference is that sort() will sort an array without concerning it’s key associations while asort() will maintain it’s key association as well.