Revision: 400
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at July 12, 2006 12:35 by nicolaspar
Initial Code
function generarPassword( $longitud, $tipo = "alfanumerico" ){
if ( $tipo=="alfanumerico" ){
$exp_reg="[^A-Z0-9]";
}elseif( $tipo=="alfa" ){
$exp_reg="[^A-Z]";
}elseif( $tipo=="numerico" ){
$exp_reg="[^0-9]";
}
return substr( eregi_replace( $exp_reg, "", md5( time() ) ) .
eregi_replace( $exp_reg, "", md5(time() ) ) .
eregi_replace( $exp_reg, "", md5( time() ) ), 0, $longitud );
}
Initial URL
Initial Description
Genera un string random del tipo especificado en $tipo y del tamaño pasado en $longitud.
Initial Title
Php generar password
Initial Tags
Initial Language
PHP