$arr = ['12','12','23']; $arr = $arr; $arr1=$arr; rsort($arr1); $c=[]; foreach ( $arr as $k=>$v){ $b= array_search($v, $arr1); $c[$k]=$b+1; } //另一种方法 public function rsort(){ $str='100,99,98,99,97,96,99,36,98,100'; $array=[]; $array = explode(',', $s