34.204.169.76 |    

Navigation

Google Advertisement

This generate a random string of 36 characters.

get_random_string
  1. // $string = get_random_string( 36 );
  2. //
  3. // This generate a random string of 24 characters.
  4. //
  5. // $string = get_random_string();
  6.  
  7. // *****************************************************************
  8. // This function generate a random string of $count length.
  9. // The default length is 24.
  10.  
  11. function get_random_string ( $count = 24 ) {
  12.  
  13. srand(time());
  14. (array) $random = array_merge( range( 0, 9 ), range( 'A', 'Z' ), range( 'a', 'z' ) );
  15. for ( (int) $i=0; $i<=$count; $i++ ) {
  16. 	(int) $rand=(int)(rand(0,count($random)));
  17.     (string) $str.=$random[$rand]; 
  18. }
  19. return $str;
  20.  
  21. }
Parsed in 0.017 seconds at 33.60 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 3 users online.

Tags Cloud

Latest snippets
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)
STDERR
(Bash::Function)
radius
(CSS)
shadow
(CSS)
rotate
(CSS)
create_function
(JavaScript::Snippets)