Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
PHP random password generator
SUBMITTED BY:
Guest
DATE:
Oct. 23, 2013, 7:13 a.m.
FORMAT:
PHP
SIZE:
690 Bytes
Raw
Download
Tweet
HITS:
1010
Go to comments
Report
<?php
/**
* The letter l (lowercase L) and the number 1
* have been removed, as they can be mistaken
* for each other.
* Tito code :eyeswideshut25@hotmail.com
*/
function
createRandomPassword
()
{
$chars
=
"abcdefghijkmnopqrstuvwxyz023456789"
;
srand
((
double
)
microtime
()
*
1000000
);
$i
=
0
;
$pass
=
''
;
while
(
$i
<=
7
)
{
$num
=
rand
()
%
33
;
$tmp
=
substr
(
$chars
,
$num
,
1
);
$pass
=
$pass
.
$tmp
;
$i
++
;
}
return
$pass
;
}
// Usage
//$password = createRandomPassword();
//echo "Your random password is: $password";
?>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus