Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. <?php
  2.  
  3. function myRandomChars($theLength = 64) {
  4.     $myChars = 'ABCDEFGHLMNOPKRSTUVWXYZ1234567890-*/$^!:;,<>';
  5.     $myId = '';
  6.     $length = strlen($myChars);
  7.     for($i=0; $i<=$theLength; $i++) {
  8.         $myId .= $myChars[rand(0, $length - 1)];
  9.     }
  10.     return $myId;
  11. }
  12.  
  13. echo myRandomChars();
  14. echo '<br><font face="Tahoma" color="red">' .strlen(myRandomChars()). '</font>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement