![]() |
PHP Random string generation help required hello people I am new to php and I just wonder I want combination of random number and random string, how can I generate it using php? Any help regarding this is highly appreciated. |
Re: PHP Random string generation help required You can use rand function of php to generate random number and you can take part of the session_id to generate random string , if you combine both of them it will give you required result |
Re: PHP Random string generation help required @bug thank you for your help but if you dont mind can you give me an example of what you have explain in php code? Thanks in advance |
Re: PHP Random string generation help required Ok here is a simple code for you. PHP Code: |
Re: PHP Random string generation help required its working fine right now but when i refresh the page first few characters remains same it only get new characters when i close browswer window and reopen it |
Re: PHP Random string generation help required You can use PHP Code: |
Re: PHP Random string generation help required Here's another way to do it... $randomString = md5(rand()); |
Re: PHP Random string generation help required For some reason I'm not able to put this in full. Check out this link: http://stackoverflow.com/a/853898 Pretty cool answer. |
Re: PHP Random string generation help required Quote:
|
Re: PHP Random string generation help required <?php function RandomTxt() { $chars = "thequickbrownfoxjumpsoverthelazydog"; srand((double)microtime()*1000000); $i = 0; $pass = '' ; while ($i <= 10) { $num = rand() % 33; $tmp = substr($chars, $num, 1); $pass = $pass . $tmp; $i++; } return $pass; } echo RandomTxt(); ?> above code useful to create random text |
Re: PHP Random string generation help required You can geenrate very good random string by session and md5 combination Quote:
|
Re: PHP Random string generation help required Hello You can use uniqid(); to randomly ganerate numbers/string |
Re: PHP Random string generation help required Have a look at tthis page PHP Randoms - Random Functions To Do Random Numbers, Random Strings, Random Files, & More |
Re: PHP Random string generation help required This might help you to generate PHP password. You can download the script if required. PHP Password Generator |
| All times are GMT -6. The time now is 02:05 AM. |