Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> losowy kod
vtuner
post
Post #1





Grupa: Zarejestrowani
Postów: 220
Pomógł: 10
Dołączył: 23.08.2005
Skąd: Łódź

Ostrzeżenie: (0%)
-----


jak zrobic aby co wejscie na strone inny kod się wyswietlal tzn losowy (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
kornelcio
post
Post #2





Grupa: Zarejestrowani
Postów: 39
Pomógł: 0
Dołączył: 19.12.2004
Skąd: Sanok

Ostrzeżenie: (0%)
-----


  1. <?php
  2.  
  3. function gen_string($long = 8){
  4.     $arr[0] = range(0, 9);
  5.     $arr[1] = range('a', 'z');
  6.     $array = array_merge($arr[0], $arr[1]);
  7.     shuffle($array);
  8. $string = '';
  9.     for ($i = 0; $i < $long; $i++){
  10.         $string .= $array[$i];
  11.     }
  12.     return $string;
  13. }
  14.  
  15. ?>


EDIT: spóźniłem się (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)

Ten post edytował kornelcio 16.11.2005, 16:47:14
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 11.10.2025 - 05:28