Get Major Training|Project Training|Live Project|Industrial Training On Android| I-Phone | Java | J2SE | J2EE | C#.Net | ASP.Net| PHP | PHP with Wordpress | Joomla | Majento Contact us

Tuesday

PHP BASIC Random password generation using PHP


Random password generation using PHP.
Option-1

echo substr(md5(uniqid()), 0, 8);


Option-2

function rand_password($length){

$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
$chars .= '0123456789' ;
$chars .= '!@#%^&*()_,./<>?;:[]{}\|=+';

$str = '';
$max = strlen($chars) - 1;

for ($i=0; $i < $length; $i++)
$str .= $chars[rand(0, $max)];

return $str;

}

echo rand_password(16);

Author: Vikas Agrawal
Vikas Agrawal is a CEO and Founder Of Vinayak Informatics Systems. Read More →

You Like It, Please Share This Article Using...



No comments:

Post a Comment

Please leave your comments and we will be reply you back ASAP
vikas agrawal