Generate Strong Password, Easy Way #PHP

If you are thinking of how passwords are automatically generated by the PHP script, just relax and have a cup of coffee. Here is very simple and strong mechanism that suits your requirement.

1. Create a file and name it as you wish but don’t forget the ‘.php’.

2. Just C & P following code in that file:

<?php

$string1=”abcdefghijklmnopqrstuvwxyz”;
$string2=”ABCDEFGHIJKLMNOPQRSTUVWXYZ”;
$string3=”1234567890″;
$string4=”!@#$%^&*()_+{}.?~”;

$string=$string1.$string2.$string3.$string4;
$string= str_shuffle($string);

$pass=substr($string,0,10); // You can increase or decrease the length, this script generate the password of length 10.

echo “Your New Password is <strong>”. $pass . “</strong><br/>”;

?>

Cheers!

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.