Skip to content

PHP code snippet – How to add to array in single without repetation?

result[0] = 11
result[1] = 22
result[2] = 33
result[3] = 11, 22
result[4] = 11, 33
result[5] = 22, 11
result[6] = 22, 33
result[7] = 33, 11
result[8] = 33, 22
result[9] = 11, 22, 33
result[10] = 11, 33, 22
result[11] = 22, 11, 33
result[12] = 22, 33, 11
And so on... (It's not necessary to have that order, i just want every possible variation (without repeating the same value on the index) on another array)
See also  CSS code snippet - How to apply on react chartjs?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.