Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $shuffled = [];
- $alphas = range('a', 'z'); // [a, ...z]
- $pattern = [1, 2, 0];
- foreach (array_chunk($alphas, 3) as $chk) {
- $r = [];
- foreach ($pattern as $i => $_) {
- $r[$i] = $chk[$pattern[$i]] ?? '';
- }
- array_push($shuffled, ...$r);
- }
- print_r(json_encode($shuffled));
Advertisement
Add Comment
Please, Sign In to add comment