- Messages
- 19,181
- Reaction score
- 28
- Points
- 48
Ok, to create a random string in php use this great code snippet I made
Any support questions can be asked here or at the phpRiots forums.
PHP:
<?php
// Brandon <brandon@phpriots.com>
// Support: http://www.phpriots.com/forums/
// Rev 1
// Edit Below
$min = "5"; // Minimum Password Length
$max = "15"; // Maximun Password Length
################## Don't edit bellow unless you know what you are doing ##################
// Letter/number Array
$useable_characters = array_merge(range('A','Z'),range('a','z'),range(0,9));
// Make the length
$length = rand($min,$max);
$password = "";
for ($i = 0; $i < $length; $i++)
{
$newrand = rand(0,61);
$password .= $useable_characters[$newrand];
}
################## Echo's the password out, or do something else with it ##################
echo $password;
?>
Any support questions can be asked here or at the phpRiots forums.
Last edited: