Jump to content

how can i verify if user's e-mail is valid ??


yami007

Recommended Posts

This will ensure a properly formatted email

 

function validEmail($emailStr)
{
    $format_test = '/^[\w\+-]+([\.]?[\w\+-])*@[a-zA-Z0-9]{2,}([\.-]?[a-zA-Z0-9]{2,})*\.[a-zA-Z]{2,4}$/';
    $length_test = '/^(.{1,64})@(.{4,255})$/';
    return (preg_match($format_test,$emailStr) && preg_match($length_test,$emailStr));
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.