3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mode = '12345'; $length = 8; $small = 'abcdefghijklmnopqrstuvwxyz'; $large = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $numeric = '0123456789'; switch ($mode) { // 小文字英字 case 'small': $chars = $small; break; // 大文字英字 case 'large': $chars = $large; break; // 小文字英数字 case 'smallalnum': $chars = $small . $numeric; break; // 大文字英数字 case 'largealnum': $chars = $large . $numeric; break; // 数字 case 'num': $chars = $numeric; break; // 大小文字英字 case 'alphabet': $chars = $small . $large; break; // 大小文字英数字 case 'alnum': default: $chars = $small . $large . $numeric; break; } $charsLength = strlen($chars); $password = ''; for ($i = 0; $i < $length; ++$i) { $num = mt_rand(0, $charsLength - 1); $password .= $chars{$num}; } echo $password;

This is an error 404

There are `0` results


preferences:
131.17 ms | 1402 KiB | 8 Q