PHPBuilder - Generate a 8 chr random string, only using undercase letters



RSS Twitter
Snippets Algorithms

Generate a 8 chr random string, only using undercase letters

by: Rasshmii
|
July 7, 2004

Version: 1.1

Type: Function

Category: Algorithms

License: Other

Description: very short function, 6 lines long.



/* $lenstr - is the length of the string you need to generate  */

function gstring($lenstr) {
	mt_srand((double)microtime()*1000000);
	while ($i<$lenstr) {
		$value .= chr(mt_rand(97,122));
		$i++;
	}
return $value;
}

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Rasshmii

Comment:



Comment:

(Maximum characters: 1200). You have characters left.