Last active
November 7, 2016 08:42
-
-
Save chihirokaasan/f00a5917b41c34c4a2ed45f246bb8ee3 to your computer and use it in GitHub Desktop.
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 | |
//ついでに非 Laravelerの人のためにランダムなパスワード生成 | |
private function makeRandomPassword() | |
{ | |
$collectionA = array_rand(array_flip(range('a', 'z')), 4); | |
$collectionB = array_rand(array_flip(range('A', 'Z')), 4); | |
$collectionC = array_rand(array_flip(range(0, 9)), 3); | |
$collectionD = array_rand(array_flip(['!','$','%','&','(',')','*','+','/']), 3); | |
$passwordstr = array_merge($collectionA,$collectionB,$collectionC,$collectionD); | |
return str_shuffle(implode($passwordstr)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment