\n"; print "\n"; print " Combination algorithm\n"; print "\n\n"; print "\n\n"; print "

Combination algorithm

\n\n"; } /** * Prints a table of combination totals. */ function print_comb_totals($comb_totals) { $grand_total = 0; print "

Totals:

\n\n"; print "\n"; print " \n"; foreach ($comb_totals as $index => $comb_total) { print " \n"; $grand_total += $comb_total; } print " \n"; print "
Group sizeTotal combinations
". ($index + 1) ."
". str_pad($comb_total, 5, ' ', STR_PAD_LEFT) ."
Grand total:
". str_pad($grand_total, 5, ' ', STR_PAD_LEFT) ."
\n\n"; } /** * Prints a list of possible combinations. */ function print_combinations($combs) { print "

Combinations:

\n\n"; print "
    \n"; foreach ($combs as $comb) { print "
  1. ". $comb ."
  2. \n"; } print "
\n\n"; } /** * Prints a page footer. */ function print_footer() { print "\n"; print "\n"; }