PX : code

randomString by Colin Viebrock
Download this code


<? php
function randomString($len) {
   srand(date("s"));
   $possible="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()";
   $str="";
   while(strlen($str)<$len) {
      $str.=substr($possible,(rand()%(strlen($possible))),1);
   }
   return($str);

?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.