PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $passwordLength = 15; $capitalLetterPosition = rand(0, $passwordLength - 1); $lowercaseLetterPosition = rand(0, $passwordLength - 1); $password = null; for ($i = 0; $i < $passwordLength; $i++) { if ($i === $capitalLetterPosition) { $password .= chr(rand(65,90)); } if ($i === $lowercaseLetterPosition) { $password .= chr(rand(97,122)); } $password .= chr(rand(48, 57)); } echo $password;
Show:  
Copy Clear