Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public static function generate($length = 6) |
||
23 | { |
||
24 | $letterStr = str_shuffle('abcdefghijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXY'); |
||
25 | $numberStr = str_shuffle('23456789'); |
||
26 | $specialStr = str_shuffle('@#&'); |
||
27 | |||
28 | $password = substr($letterStr, 0, $length - 3) |
||
29 | . substr($numberStr, 0, 2) |
||
30 | . substr($specialStr, 0, 1); |
||
31 | |||
32 | return str_shuffle($password); |
||
33 | } |
||
44 |