Platinum Partner

Random Password Generator In PHP

A little function which generates random password of a certain length. It uses all letters, both lowercase and uppercase and all numbers.


//generates a random password which contains all letters (both uppercase and lowercase) and all numbers
function generatePassword($length) {
$password='';
for ($i=0;$i<=$length;$i++) {
	$chr='';
	switch (mt_rand(1,3)) {
		case 1:
			$chr=chr(mt_rand(48,57));
			break;
		case 2:
			$chr=chr(mt_rand(65,90));
			break;
		case 3:
			$chr=chr(mt_rand(97,122));
			
	}
	$password.=$chr;
}	
return $password;
}
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}