Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use rsort() function in php ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 106
    Comment on it

    Let us know What is tht rsort() function in php ?

    The rsort() function sorts array in decending order menas highest to lowest.

    why use rsort() function in php ?

    rsort() function basically used for sorting the elements of the array in decending alphabetical order:

    You can see below example of rsort() function in php.

    <?php
    
    $CountryName=array("Japan","India","Nepal","Rasia");
    //here $CountryName is a variable
    rsort($CountryName);
    //now call the rsort() for sorting country name in decending order
    
    //loop rstart for count name
    for($i=0;$i<count($CountryName);$i++)
       {
         echo $CountryName[$i];
          echo "<br>";
       }
    ?>
    

    Output will come following:Rasia

    Nepal

    Japan

    India

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: