Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $int = (isset($_GET['int']) && is_numeric($_GET['int']) && $_GET['int'] >= 3 && $_GET['int'] <= 9) ? $_GET['int'] : rand(3, 9);
- $strings = [];
- $abc = ['a','b','c','d','e','f','g','h','j','k','m','n','p','q','r','s','t','u','v','w','x','y','z'];
- for($i = 1; $i <= $int; $i++) {
- $strings[] = get_letter(rand(1, 10000), rand(0, 1) == 0 ? 0 : 1);
- }
- function get_letter($i, $modus) {
- global $abc;
- if($i > count($abc)-1) {
- return get_letter($i-count($abc), $modus);
- }
- return ($modus == 0) ? $abc[$i] : strtoupper($abc[$i]);
- }
- $result = '';
- foreach($strings as $string) {
- $result .= $string;
- }
- echo $result;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement