answersLogoWhite

0


Best Answer

Assuming that the values are stored in an array, you can use the php function sort($array) to sort ascending, and rsort to sort descending. The following link gives a table that lists all of the built in PHP sort functions:

http://php.net/manual/en/array.sorting.php

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you sort variable in ascending or descending order both in php?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between harmonic and natural minor?

The seventh degree is raised by a semitone both ascending and descending.


Is an ascending aortic aneurysm more dangerous than a descending aortic aneurysm?

No. Both are equally dangerous.


What is the difference between melodic and harmonic minor and major scales?

Harmonic minor scale has a raised 7th in both ascending and descending scales. Melodic minor has raised 6th and 7th in ascending scale. It is similar to natural minor in descending scale.


Write an Assembly language program which implements sorting algorithm both ascending and descending order and display those numbers with certain delay say of 5sec between successive displays?

das


What is the purpose of valsalva manoeuvre?

The purpose is to equalize the pressure on both sides of the ear drums. It can prevent problems when ascending to and descending from high altitudes such as when on an airplane or a high rise elevator.


Second order neurons of both specific and nonspecific ascending pathways terminate where?

Thalamus.


How many such pairs of digits are there in number 36725918 each of which has as many digits between them in the number as when the digits are arranged in descending order within the numbers?

The number is: 36725918 In descending order that is: 98765321 The pairs of numbers that have as many digits between them in both are: 3,9 5,8 6,7 So there are three pairs.


What are the similarities between Hindi Arabic system and roman Numbers?

They are both worked out in descending order of greatness and they both are increased by increments of 1's 10's 100's ... etc


In first order both x and y in chemistry?

what in 1st order?? if you are asking about 1st order chemical equation then there will be only one variable with power 1.


What does three point contact mean when using a ladder?

It means that at least three points of your body, it might be either two hand and one foot or one hand and two feet, must be in touch with the ladder while ascending or descending. So keep your both hands free, never carry anything with your hands, while climbing. Please note that the important part is while ascending and descending. Once you arrive to the level you want to work at, you may do light work that may require both hands. Do not lean out far enough to cause your belt buckle to extend outside the side rails. THERE IS NO FALL PROTECTION REQUIRED ON LADDERS. Always follow manufacturer's recommendations.


What is a paerto chart?

a type of chart that contains both bars and a line graph, where individual values are represented in descending order by bars, and the cumulative total is represented by the line.


Explain how to solve for the variable in a multiplication equation such as 2.3a equals 4.6?

2.3a = 4.6 In order to leave the variable alone (without the coefficient), divide by 2.3 to both sidesa = 2