Adilol

StringBuilder()

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