PHP Script to Generate Random Password. You can set the list of characters that you want to be used in password. You can also set what should be length of password.
<?php
/*
This function generates a random password.
It can contain any set of characters that you specify.
You can also control the length of generated password.
*/
function simplePasswordGenerator($length) {
// This is the list of characters that you want to use for generating random password
$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.-+=_,!@$#*%<>[]{}';
$password = array(); //$password as an array, which will later be converted to string
$alphaLength = strlen($characters) - 1; //This is number up to which array index runs
for ($i = 0; $i < $length; $i++) {
$n = rand(0, $alphaLength);
$password[] = $characters[$n];
}
return implode($password); //turn the array into a string
}
// Calling the function
$length=8;
echo simplePasswordGenerator($length);
?>
PHP code to generate password which contains at least one small letter, one capital letter, one number and one special character.
Price $5 Order Now
I want a random Credit Card number generator.
Price $5 Order Now
I want a PHP function to generate random email addresses.
Price $5 Order Now
I want a random IP address generation code. I must be a PHP function.
Price $5 Order Now
A very simple php snippet to check if an email id is valid or not. If the email address is...
This PHP Code snippet lists all files in a folder and hyperlinks them accordingly. Very clean, easy to use function....
This PHP function extracts all numbers from a String and prints them as a comma separated list of numbers. Ready...
PHP Script to create URL from string. It retails only URL Safe characters in the strings. So, now easily create...
It is a very nice PHP time ago function. You gave pass any date to it and it will tell...
PHP Script to extract all links from a web page. This PHP Snippet reads the contents of a web page...
PHP Script to create thumbnail of any image (.jpg, .png and .gif). This create thumbnail function is ready to use....
This is a simple function written in PHP to generate keywords from any text. Just pass any free text to...