![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
28/06/2002, 11:05
|
| | Fecha de Ingreso: noviembre-2001
Mensajes: 108
Antigüedad: 23 años, 3 meses Puntos: 2 | |
Re: Generar un número aleatorio para de sufrir:
hay te va esper te solucione lo tuyo ok
<? function crearContrasena ($intSemilla,$strCaract = 10) { // //Caracteres especiales // $arrPos = array('!','@','#','$','%','&','*','(',')','_', '+','-'); // //Agregamos valores alfanumericos // $arrRes = array_merge($arrPos,range(0,9),range('a','z'),rang e('A','Z')); while(strlen($pass) < $strCaract) { $pass .= (string)$arrRes[rand(0,sizeof($arrRes))]; } return $pass; } $semilla = srand((double)microtime()*1000000); // //llamamos a la funcion // echo crearContrasena($semilla); ?> |