Created
June 19, 2019 08:40
-
-
Save abdullahbutt/76fef6c936e911d34d46806f563d11d5 to your computer and use it in GitHub Desktop.
generating random alphanumeric strings in php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// https://code.tutsplus.com/tutorials/generate-random-alphanumeric-strings-in-php--cms-32132 | |
//$permitted_chars = '0123456789abcdefghijklmnopqrstuvwxyz'; | |
$permitted_chars = '0123456789abcdefghijklmnopqrstuvwxyz!@#%'; | |
// Output: 54esmdr0qf | |
$password = substr(str_shuffle($permitted_chars), 0, 8); | |
echo $password; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment