<?php print_r(every(array(3,2,2))); print_r(every(array(1,2,3,4))); function every($levels) { $results = array(); $i = 0; while(true) { $current = $i; $result = array(); foreach(array_reverse($levels) as $max) { array_unshift($result, $current % $max); $current = intval($current / $max); } if($current >= 1) { break; } else { $results[] = $result; $i++; } } return $results; }
You have javascript disabled. You will not be able to edit any code.
This script was stopped while abusing our resources