home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / src / PHP / php.exe / Randomstring.php < prev    next >
Encoding:
Text File  |  2001-07-03  |  452 b   |  21 lines

  1.     //**************************************
  2.     //     
  3.     // Name: Randomstring
  4.     // Description:Generate a random string 
  5.     //     of n characters by Christopher Heschong
  6.     // By: PHP Code Exchange
  7.     //**************************************
  8.     //     
  9.     
  10.     <?
  11.     Function randomstring($len) {
  12.     srand(date("s"));
  13.     while($i<$len) {
  14.     $str.=chr((rand()%26)+97);
  15.     $i++;
  16.     }
  17.     return $str;
  18.     }
  19.     ?>
  20.  
  21.