Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $root = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'];
- $inserts = [1, 2];
- foreach ($inserts as $insert) {
- for ($i = 0; $i <= count($root); $i++) {
- $root_instance = $root;
- array_splice($root_instance, $i, 0, $insert);
- foreach ($inserts as $var) {
- for ($y = 0; $y <= count($root) + 1; $y++) {
- $root_instance2 = $root_instance;
- array_splice($root_instance2, $y, 0, $insert);
- echo implode(' ', $root_instance2) . '<br>';
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement