Allow character to appear more than once
Allow character to appear more than once

Using str_shuffle means that each character can only occur once in the generated string. This reduces the number of permutations possible. For example, using base 36, and 4 characters, there are 36^4 = 1.68M, but the current function can only generate 36*35*34*33 = 1.41M of these. This alternative will use the whole range of possible strings.
YOURLS/random-keywords