Return to Snippet

Revision: 17050
at August 21, 2009 11:46 by level09


Initial Code
function generate_rand($l){
  $c= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  srand((double)microtime()*1000000);
  for($i=0; $i<$l; $i++) {
	  $rand.= $c[rand()%strlen($c)];
  }
  return $rand;
 }

Initial URL

                                

Initial Description

                                

Initial Title
Generate Random String (ids etc ..)

Initial Tags

                                

Initial Language
PHP