In this post we have explained about how to generate strong password in PHP. Following function is very easy to generate strong password with alphanumeric and custom special characters too.

generate_strong_password_in_php

function generate_password( $length = 8 ) {
$chars = "[email protected]#$%^&*()_-=+;:,.?";
$password = substr( str_shuffle( $chars ), 0, $length );
return $password;
}

parameter input is your wish default value is 8 as we mentioned see in above function.

 echo generate_password(); // default

 echo generate_password(5); // custom parameter

 

 

Share Your Thoughts

0 Comments
Inline Feedbacks
View all comments
Subscribe Our Channel

Email Subscription
Watch Tutorials
Loading
Copyright © 2015 - 2021 PHPEXPERTISE.COM