PHP: Sort array numerically descending
Use rsort()
.
rsort( $outcomes_array )
Note, it is not
$outcomes_array = rsort( $outcomes_array );
rsort( $outcomes_array );
print_r( $outcomes_array );
Use rsort()
.
rsort( $outcomes_array )
Note, it is not
$outcomes_array = rsort( $outcomes_array );
rsort( $outcomes_array );
print_r( $outcomes_array );