Adilol

StringBuilder

Oct 16th, 2011
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1.  
  2. <?php
  3. /***
  4.  * Created by Adil && Dominic (Myrax)
  5.  * Used to generate a random SSO ticket
  6.  * @author 'Adil'
  7.  * October 16th 2011
  8.  */
  9. function adilsRandomString() {//calls the function
  10.     $alphanumerics = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';//declears our chars and ints
  11.   $result = 'user';//username here
  12.     for ($x = 0; $x < 32; $x++) {//keeping the character length to 32, change the 32 to vary lengths
  13.         $result .= $alphanumerics [mt_rand(0, strlen($alphanumerics))];//$result+string
  14.     }
  15.    return $result;//returns the result, without this, we won't recieve the result
  16. }
  17. echo adilsRandomString();//shows the SSO ticket
  18. ?>
  19.  
Advertisement
Add Comment
Please, Sign In to add comment