| | |||||
| ||||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Member Join Date: Aug 2009
Posts: 26
![]() | [TUTORIAL]Generating Random string Just simple code to generate random strings: You can change the chars in $chars ![]() PHP Code: |
| | |
| | #2 (permalink) |
| NamePros Regular Join Date: Jul 2008 Location: Wichita, KS
Posts: 287
![]() ![]() ![]() ![]() | Great function. The one I usually use for PHP is: PHP Code: Code: function random_id(){
var
charset='0123456789abcdefghijklmnopqrstuvqxyzABCDEFGHIJKLMNOPQRSTUVQXYZ',
max=charset.length,
id='',
len=32,
ptr;
while(len--)
id+=charset.substring(ptr=Math.floor(Math.random()*max),ptr+1);
return id
};
__________________ Free Services: Alertable.com, DetectMobileBrowser.com, DropCart.com, FreeCronJobs.com, HTMLDTD.com, ImagePNG.com, NoCart.com, phpMyLogin.com, RandomTweeps.com, SearchFriendlyURLs.com For Sale: Keyword Domains / Generics See Also:: Google Voice Add-on for Firefox, Google Wave Add-on for Firefox |
| | |