Ver Mensaje Individual
  #6 (permalink)  
Antiguo 06/01/2010, 07:33
Hidek1
Colaborador
 
Fecha de Ingreso: octubre-2009
Ubicación: Tokyo - Japan !
Mensajes: 3.867
Antigüedad: 15 años, 5 meses
Puntos: 334
Respuesta: Problemas validar direccion de correo

Código PHP:
Ver original
  1. /**
  2.  * Valid email entered or return your information separately
  3.  *
  4.  * @param   $email string
  5.  * @param   $data boolean[optional]
  6.  * @return  boolean or array information
  7.  */
  8. function valida_email($email,$data=false){
  9.     $pattern = '/^([\w\d\.-]{1,50})@{1}([\w\d-]{1,50})\.{1}([\w\d-]{1,5})(?:\.{1}([\w\d-]{1,5}))?$/i';
  10.     if(preg_match($pattern,$email,$matches)){
  11.         return($data)?$matches:True;
  12.     }
  13. }

la hice hace un par de días por que la pedían mucho por acá !

saludos
__________________
More about me...
~ @rhyudek1
~ Github