understand that php doesn't care about the order if all the compared values โโare the same.
Example:
$temp=array("b"=>"10","c"=>"10","d"=>"10","e"=>"4");
as indicated above, the array has 4 array lengths, in which 3 have the same values โโas shown b, c, d = 10; arsort() // The arsort () function sorts the associative array in descending order, according to the value
if print_r(arsort($temp)) o / p: => Array ( [b] => 10 [c] => 10 [d] => 10 [e] => 4 )
this means that it returns an array after sorting the equal value, but keeps the position (order) the same for equal values
but
if $temp=array("a"=>"4",b"=>"10","c"=>"10","d"=>"10","e"=>"4"); here in the above array, b, c, d = 10 are limited by two extreme left and right arrays having a value less than the center values โโ(b, c, d = 10)
arsort above temp - o / p: Array ( [c] => 10 [b] => 10 [d] => 10 [a] => 4 [e] => 4 )
it gives the middle part ie [c] the array in the center. this means that if identical values โโor equal value arrays are bounded on both sides by an array with lower values, and the first value is lower, then the order of equal gives the average of the three values โโof the array as the first in these three.