What's Here?
- Members: 131,911
- Replies: 470,169
- Topics: 72,873
- Snippets: 2,538
- Tutorials: 665
- Total Online: 1,681
- Members: 63
- Guests: 1,618
Who's Online?
|
A function to generate a random password given the length
|
Submitted By: Moonbat
|
|
|
Rating:
|
|
Views: 183 |
Language: PHP
|
|
Last Modified: August 25, 2008 |
Snippet
<?php
/****************************
* Random Password Generator *
* Written by Moonbat *
* August 25, 2008 *
****************************/
function GeneratePassword($length) {
$password = '';
$string = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 0 ! @ # $ % ^ & * ~";
for ($i=0;$i<=$length;$i++) {
$password .= $chars[$random];
}
return $password;
}
?>
Copy & Paste
|
|
|
Reference Sheets
Bye Bye Ads
Free DIC T-Shirt
Related Sites
Monthly Drawing
Partners
Top Contributors
Top 10 Kudos This Month
|