彩票排列三组选三算法
程序员文章站
2022-04-22 14:18:18
...
跳至
function arrange($arr){ $new_arr = array(); $c = count($arr); foreach($arr as $key=>$vo){ $lin = $arr; array_splice($lin,$key,1); for($l=0;$l<$c-1;$l++){ $larr = array(); $larr[] = $lin[$l]; $larr[] = $vo; $larr[] = $vo; $new_arr[] = $larr; } } return $new_arr; } $arr = array(1,2,3,4); $r = arrange($arr);