diff options
author | Timothy Warren <tim@timshomepage.net> | 2011-09-07 18:14:12 +0200 |
---|---|---|
committer | Timothy Warren <tim@timshomepage.net> | 2011-09-07 18:14:12 +0200 |
commit | 770c8677207be0a9091456b8d763bfd0e5456606 (patch) | |
tree | f9cd1d88c105ede5a977e4d4abfea8716c4a531b /system/helpers | |
parent | 018af7a82749cb5c6d224940ab5f08d801f54988 (diff) | |
parent | ec36dc8001f315fda9bfb37d283493ce5c34da57 (diff) |
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/helpers')
-rw-r--r-- | system/helpers/string_helper.php | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index 9fa69f46c..dd8ffaddb 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -215,12 +215,9 @@ if ( ! function_exists('random_string')) case 'nozero' : $pool = '123456789'; break; } - - $str = ''; - for ($i=0; $i < $len; $i++) - { - $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); - } + + $str = substr(str_shuffle(str_repeat($pool, ceil($len/strlen($pool)))),0,$len); + return $str; break; case 'unique' : |