我面临一个大问题.我需要生成精确的7个数字组合,并且我使用7个forloops编写了一个代码,并且它的工作正常,数量非常少.请检查附件,这样你就会非常清楚我需要什么.请提供PHP结果.
<?php
// I need the combinations for this commented numbers
// 1, 7, 13, 19, 25, 31, 2, 8, 14, 20, 26, 32, 3, 9, 15,
// 21, 27, 33, 4, 10, 16, 22, 28, 34, 5, 11, 17, 23, 29,
// 35, 6, 12, 18, 24, 30, 36
$string=array(1,7,13,19,25,31,2,8,14,20,26,32,3,9,15,21,27,33,4,10,16,22,28,34);
$len=count($string);
$c=0;
ob_start();
for ($e = 0; $e < $len - 6; $e++)
{
for ($f = $e+1; $f < $len - 5; $f++)
{
for ($g = $f+1; …Run Code Online (Sandbox Code Playgroud)