/ Published in: PHP
                    
                                        
Genera un string random del tipo especificado en $tipo y del tamaño pasado en $longitud.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
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]";
}
}
Comments
 Subscribe to comments
                    Subscribe to comments
                
                