Php Code To Generate Strong Password

[Solved] Php Code To Generate Strong Password | Php - Code Explorer | yomemimo.com
Question : php code to generate strong password

Answered by : saptarshi-mondal

<?php function randomPassword() { $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; $pass = array(); //remember to declare $pass as an array $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache for ($i = 0; $i < 8; $i++) { $n = rand(0, $alphaLength); $pass[] = $alphabet[$n]; } return implode($pass); //turn the array into a string } echo randomPassword();

Source : | Last Update : Thu, 06 May 21

Answers related to php code to generate strong password

Code Explorer Popular Question For Php