Ver Mensaje Individual
  #2 (permalink)  
Antiguo 17/10/2003, 11:23
Avatar de nuevo
nuevo
 
Fecha de Ingreso: mayo-2003
Ubicación: Spain
Mensajes: 2.009
Antigüedad: 20 años, 11 meses
Puntos: 2
rand
(PHP 3, PHP 4 )

rand -- genera un valor aleatorio
Descripción
int rand ( [int min [, int max]])


Si es llamada sin los argumentos opcionales min y max, rand() devuelve un valor pseudo-aleatorio entre 0 y RAND_MAX. Si quiere un número aleatorio entre 5 y 15 (inclusive), por ejemplo, use rand(5,15).

Recuerde introducir la semilla del generador de números aleatorios antes de usar srand().

Vea también srand(), getrandmax(), mt_rand(), mt_srand() y mt_getrandmax().

---------------------------------------------------

srand
(PHP 3, PHP 4 )

srand -- introduce la semilla del generador de números aleatorios
Descripción
void srand ( int seed)


Inicializa el generador de números aleatorios con seed.


// seed son los microsegundos desde el último segundo "entero"
srand((double)microtime()*1000000);
$randval = rand();




Vea también rand(), getrandmax(), mt_rand(), mt_srand() y mt_getrandmax().

-----------------------
mas info...
http://es2.php.net/manual/es/function.srand.php
__________________
3w.valenciadjs.com
3w.laislatv.com