Last active
May 14, 2017 21:25
-
-
Save ahmeti/878cea6940a4d4f14de551d12d0652e1 to your computer and use it in GitHub Desktop.
combination.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$refinements=array( | |
'Type' => array( | |
'Toppe', | |
'Bukser_og_Jeans' | |
), | |
'Size' => array( | |
'Extra_small', | |
'Small' | |
), | |
'Colour' => array( | |
'Rod' | |
) | |
); | |
$data=[]; | |
$iter = 0; | |
while (1) { | |
$num = $iter++; | |
$pick = array(); | |
foreach ($refinements as $refineGroup => $groupValues) { | |
$r = $num % count($groupValues); | |
$num = ($num - $r) / count($groupValues); | |
$pick[] = $groupValues[$r]; | |
} | |
if ($num > 0) { | |
break; | |
} | |
//print join(', ', $pick)."<br>"; | |
$data[]=$pick; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment