获取二维数组 所有的组合排列
/***
* 获取所有的组合
*
* 1,2
* 0,1
* 2,3
*
* 则得出8种组合排列;
*/
private function get_combination($all_score_lists){
$res = [];
foreach($all_score_lists as $k => $v)
{
if(!$res)
{
foreach($v as $vv)
{
$res[] = [$vv];
}
} else {
$new_res = [];
foreach($v as $vv)
{
foreach($res as $vvv)
{
array_push($vvv,$vv);
$new_res[] = $vvv;
}
}
$res = $new_res;
}
}
return $res;
}
相信坚持的力量,日复一日的习惯.