Tuesday, 18 August 2015

Sorting the elements of array

In this tutorial we will learn how to sort the elements of an array on the basis of the keys or values as per the requirement.We will discuss the following sorting functions with example:
  1. sort()
  2. rsort()
  3. asort()
  4. ksort()
  5. arsort()
  6. krsort()

  1. sort() is used for sorting elements of an array in ascending order
    1. $fruits = array('mango','grapes','apple','pineapple');
    2. sort($fruits);
    3. $length= sizeof($fruits);




- For complete explanation through examples, Read full Blog at: Sorting the elements of array

FindNerd is an effective C, Java, Android, Html, iOS, JavaScript, PHP developer forum, to instantly resolve your various language queries.

Apart from this, If you have any html language issue, you can post at HTML questions and answers and get instantly resolved it from highly experienced FindNerd community members.

No comments:

Post a Comment