时间:2021-07-01 10:21:17 帮助过:23人阅读
$ar = array ( array ( 'ak' => '1', 'fs' => '12', 'tss' => 'sd第三方f', ), array ( 'ak' => '2', 'fs' => '12', 'tss' => '是的发生', ), array ( 'ak' => '3', 'fs' => '22', 'tss' => '好新玩', ), array ( 'ak' => '4', 'fs' => '22', 'tss' => '八实得分', ), array ( 'ak' => '6', 'fs' => '22', 'tss' => '八实得分', ),);$res = array();foreach($ar as $r) { $t = $r['fs']; unset($r['fs']); $res[$t][] = $r;}print_r($res);
Array( [12] => Array ( [0] => Array ( [ak] => 1 [tss] => sd第三方f ) [1] => Array ( [ak] => 2 [tss] => 是的发生 ) ) [22] => Array ( [0] => Array ( [ak] => 3 [tss] => 好新玩 ) [1] => Array ( [ak] => 4 [tss] => 八实得分 ) [2] => Array ( [ak] => 6 [tss] => 八实得分 ) ))
感受就是牛B。