suppose i have

$val_1 = 100;

$val_2 = 250;

$val_3 = 180;

$val_4 = 150;

is there a function to arrange them in order from max value to min value?

$arr_position = array();

$arr_position[0] = $val_2;

$arr_position[1] = $val_3;

$arr_position[2] = $val_4;

$arr_position[3] = $val_1;

where $arr_position[0] stores max values, and then follow on…