daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Feb 23rd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function get_random_code(){
  2.     // 675O-7OAF-3LLV-H0CK
  3.     $code = '';
  4.     $letters_numbers = array_merge( range('A', 'Z'), range(0,9) );
  5.     $letters = range('A', 'Z');
  6.  
  7.     for($i=0; $i < 20; $i++){
  8.         if($i < 3)
  9.             $code .= $letters[array_rand($letters)];
  10.         else if($i % 5)
  11.             $code .= $letters_numbers[array_rand($letters_numbers)];
  12.         else
  13.             $code .= '-';
  14.     }
  15.  
  16.     $code = substr($code, 1);
  17.     return $code;
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top