Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function randomkey(){ return substr(str_shuffle(str_repeat("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 10)), 0, 6); }
- for ($i=0;$i<5;++$i)
- echo randomkey()."\n";
- function random_string($length) {
- $key = '';
- $keys = array("↑","↓","→","←","2↑","2↓","2→","2←","3↑","3→","3↓","3←");
- for ($i = 0; $i < $length; $i++) {
- $key .= $keys[array_rand($keys)];
- }
- return $key;
- }
- $rand_string = random_string(15);
- echo htmlentities($rand_string);
- public function code_generator($max_num = 6, $prefix = "PGD")
- {
- if ( (strlen(self::TOTAL_MAX_LIMIT)+$max_num) > self::TOTAL_MAX_LIMIT ) {
- return false;
- } else {
- $min = pow(10, $max_num - 1) ;
- $max = pow(10, $max_num) - 1;
- return $prefix.mt_rand($min, $max);
- ///return $prefix.mt_rand($max_num,$max_num); /* return fix length of number */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement