Random PAssword Generation
Posted: Sun Aug 15, 2004 11:49 am
Hi. How would i generate a long radnom password, consisting of numbers and letters?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$strList=array();
for ($i=48;$i<=57;$i++) $strList[]=chr($i);
for ($i=65;$i<=90;$i++) $strList[]=chr($i);
for ($i=97;$i<=122;$i++) $strList[]=chr($i);
$Pass="";
for ($i=0;$i<50;$i++) $Pass.=$strList[rand(0,count($strList)-1)];
echo $Pass;
?>