Home
Forums
Members
Search
Help
New topics
Todays topics
Website
Welcome Guest, Not a member yet?
Register
Sign In
Login
Username:
Password:
Remember me
Lost Password?
CodeIgniter Forums
Using CodeIgniter
General Help
function random_string in string_helper
Share on Google
Share on Facebook
Share on Twitter
View a Printable Version
Subscribe to this thread
Add Poll to this thread
Send thread to a friend
Linear Mode
Threaded Mode
function random_string in string_helper
lisheng51
Newbie
Posts:
3
Threads:
1
Joined:
Jan 2017
Reputation:
0
#1
01-02-2017, 03:02 AM
PHP Code:
return
substr
(
str_shuffle
(
str_repeat
(
$pool
,
ceil
(
$len
/
strlen
(
$pool
)))),
0
,
$len
);
Is not better with this way: substr(str_shuffle($pool), 0, $len);
it is even faster than
substr(str_shuffle(str_repeat($pool, ceil($len / strlen($pool)))), 0, $len); ??
Reply
Wouter60
Posting Freak
Posts:
851
Threads:
38
Joined:
Feb 2015
Reputation:
77
#2
01-02-2017, 08:53 AM
It's not clear what your question is. What do you want to know about random_string() ?
Reply
Narf
Me
Posts:
1,589
Threads:
1
Joined:
Oct 2014
Reputation:
121
#3
01-03-2017, 06:51 AM
He wants to suggest changes to it.
No, these changes don't make it better.
In fact, nothing will make it better.
That function is fundamentally broken.
Reply
--------------------
Private Messages
User Control Panel
Who's Online
Search
Forum Home
General
-- News & Discussion
-- Events
-- Lounge
-- Regional User Groups
Using CodeIgniter
-- Installation & Setup
-- Model-View-Controller
-- Libraries & Helpers
-- Best Practices
-- Choosing CodeIgniter
-- General Help
CodeIgniter 4
-- CodeIgniter 4 Roadmap
-- CodeIgniter 4 Development
-- CodeIgniter 4 Feature Requests
-- CodeIgniter 4 Support
-- CodeIgniter 4 Discussion
-- CodeIgniter 4 Addins
Development
-- CodeIgniter 3.x
-- CodeIgniter 2.x
-- Issues
-- NetBeans Plugin
External Resources
-- Spotlight
-- Learn More
-- Jobs
-- Addins
Archived Discussions
-- Archived Libraries & Helpers
-- Archived Development & Programming
Theme © iAndrew 2016 -
Forum software by © MyBB