ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
``` <?php $fuck=[['aa'=>'34','bb'=>'33'],['aa'=>'43','bb'=>'41'],['aa'=>'13','bb'=>'12'],['aa'=>'88','bb'=>'40']]; function array_sort($arr,$keys,$orderby='asc'){ $keysvalue = $new_array = array(); foreach ($arr as $k=>$v){ $keysvalue[$k] = $v[$keys]; } if($orderby== 'asc'){ asort($keysvalue); }else{ arsort($keysvalue); } reset($keysvalue); foreach ($keysvalue as $k=>$v){ $new_array[] = $arr[$k]; } return $new_array; } echo "<pre>"; print_r(array_sort($fuck,'aa','desc')); echo "<pre>"; ?> ```