时间:2021-07-01 10:21:17 帮助过:6人阅读
$d = explode(',', '012345678,013456789,023456789,012456789,023456789');$r = array();for($i=0; $i你可能需要有随机性的 $d = explode(',', '012345678,013456789,023456789,012456789,023456789');$r = array();for($i=0; $i我是想把所有能组成的5位数都显示出来,我没写清楚
循环 去重呗
$d = array_map('str_split', explode(',', '012345678,013456789,023456789,012456789,023456789'));print_r(foo($d));function foo($d) { $r = array_pop($d); while($d) { $t = array(); foreach(array_pop($d) as $k1=>$x) { foreach($r as $k2=>$y) $t[] = "$x $y"; } $r = $t; } return $r;}