Ver Mensaje Individual
  #5 (permalink)  
Antiguo 05/04/2010, 09:01
Avatar de jcxnet
jcxnet
 
Fecha de Ingreso: octubre-2005
Ubicación: Perú
Mensajes: 784
Antigüedad: 18 años, 7 meses
Puntos: 56
Respuesta: Este codigo solo genera como numero aleatorio "2" ¿donde está el fallo?

podrías reducir tu función de esta manera:
Código PHP:
function make_seed(){
  list(
$usec$sec) = explode(' 'microtime());
  return (float) 
$sec + ((float) $usec 100000);
}

function 
numale(){
 
$numeros = array('1','x','2');
 
srand(make_seed()); 
 
$num rand(0,2);
 return 
$numeros[$num];

__________________
►I'm a devil on the run ♂
Jcxnet.com
*Keep It Simple **