How to reduce for loop speed.
i'm facing a big issue.  i need to generate exact 7 number combinations and i written a code for that by using 7 forloops and also it is working fine with very less numbers.Please check the attachment so you will be very clear what i need actually. 
Please provide PHP result.
i need the combinations for the below mentioned 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
<?php

 $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; $g < $len - 4; $g++)
    {
     for ($h = $g+1; $h < $len - 3; $h++)
     { 
      for ($i = $h+1; $i < $len - 2; $i++)
      {
       for ($j = $i + 1; $j < $len - 1; $j++)
       {
        for ($k = $j + 1; $k < $len; $k++)
        {
         $c++;
         $output[]=$string[$e].",". $string[$f].",". $string[$g].",". $string[$h].",".$string[$i].",". $string[$j].",". $string[$k];
         ob_flush();
        }
        ob_flush();
       }
       ob_flush();
      }
      ob_flush();
     }
     ob_flush();
    }
    ob_flush();
   }
   ob_flush();
  }
echo count($output);
?>

How to reduce for loop speed.
===

i'm facing a big issue.  i need to generate exact 7 number combinations and i written a code for that by using 7 forloops and also it is working fine with very less numbers.Please check the attachment so you will be very clear what i need actually. 
Please provide PHP result.
i need the combinations for the below mentioned 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
<?php

 $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; $g < $len - 4; $g++)
    {
     for ($h = $g+1; $h < $len - 3; $h++)
     { 
      for ($i = $h+1; $i < $len - 2; $i++)
      {
       for ($j = $i + 1; $j < $len - 1; $j++)
       {
        for ($k = $j + 1; $k < $len; $k++)
        {
         $c++;
         $output[]=$string[$e].",". $string[$f].",". $string[$g].",". $string[$h].",".$string[$i].",". $string[$j].",". $string[$k];
         ob_flush();
        }
        ob_flush();
       }
       ob_flush();
      }
      ob_flush();
     }
     ob_flush();
    }
    ob_flush();
   }
   ob_flush();
  }
echo count($output);
?>
