CodeIgniter Forums
random_string() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: random_string() (/showthread.php?tid=41272)



random_string() - El Forum - 05-03-2011

[eluser]SaSa[/eluser]
hello
I want using of the string Numeric.
Code:
$this->load->helper('string');
echo random_string('numeric', 6);
did is likely repeated string Numeric?


random_string() - El Forum - 05-03-2011

[eluser]MathBoon[/eluser]
Code:
random_string()

Generates a random string based on the type and length you specify.

Could you repeat your question? It's not really understandable.


random_string() - El Forum - 05-04-2011

[eluser]SaSa[/eluser]
did this string is unique?(Not duplicate)


random_string() - El Forum - 05-04-2011

[eluser]darrentaytay[/eluser]
This will not give you a unique number and it's entirely possible for it to be duplicated.


random_string() - El Forum - 05-04-2011

[eluser]SaSa[/eluser]
Thanks
For a string with six unique characters do what?
Please tell an example


random_string() - El Forum - 05-04-2011

[eluser]danmontgomery[/eluser]
Your question is entirely too vague. Unique to what? Are you talking distributed, globally unique keys? "Unique" in that no two generated are ever the same? No two consecutive? Numeric? Alphanumeric? Help us help you.


random_string() - El Forum - 05-04-2011

[eluser]SaSa[/eluser]
Unique for store to database. (not repeat)
the type no matter, numeric or alphanumeric.with six characters


random_string() - El Forum - 05-04-2011

[eluser]danmontgomery[/eluser]
What good reason is there to force 6 characters? If you're talking about distributed keys, you need to use UUIDs, and they will be much longer than 6 characters. If you're not, save yourself the headache and use auto increment.