时间:2021-07-01 10:21:17 帮助过:17人阅读
$arr =array( 11=>2530, 13=>8922, 26=>250, 77=>250, 88=>1230, 99=>12);
array(99=>12,26=>250,77=>250)
$arr =array( 11=>2530, 13=>8922, 26=>250, 77=>250, 88=>1230, 99=>12);asort($arr);print_r(array_slice($arr, 0, 3, true));
Array( [99] => 12 [77] => 250 [26] => 250)
$arr =array( 11=>2530, 13=>8922, 26=>250, 77=>250, 88=>1230, 99=>12);asort($arr);print_r(array_slice($arr, 0, 3, true));
Array( [99] => 12 [77] => 250 [26] => 250)