Let's say I have an array consisting of characters from these ranges "a-zA-Z0-9". What I want to do is get all possible combinations possible in a 4-letter range. Characters can be repeated in the string. I'm looking for a brute-force way to do it.
This is how I believe the iteration would be:
"aaaa" "aaab" "aaac" ... "9999"
to random access you can use base_convert:
or manuel if your base is larger then 36 (you have more then 36 Chars)
to iterate you can use:
this way is not that fast as the brute force methode.
Regards Thomas
In brute-force fashion:
You'll end up with a honkin' big array, so you might want to sprinkle some database operations into one of the loops, so $strings doesn't get too big and kill your script by hitting a memory limit.