Is valid email
#7

Show some respect, and say "thank you mighty dad" then!

PHP Code:
main()
{
    print((
IsValidEmail("@hotmail.com")) ? ("1. Yes") : ("1. No"));
    print((
IsValidEmail("spiderman@outlook.com")) ? ("2. Yes") : ("2. No"));
    print((
IsValidEmail("superman@hotmail.com")) ? ("3. Yes") : ("3. No"));
    print((
IsValidEmail("batman@gmail.com")) ? ("4. Yes") : ("4. No"));
}
IsValidEmail(const email[])
{
    new 
at_pos strfind(email"@"true) + 1;
    if(
email[0] == '@' || at_pos == -1)
    {
        return 
false;
    }
    static const 
providers[][] =
    {
        
"hotmail.com",
        
"gmail.com"
    
};
    for(new 
0sizeof(providers); ++)
    {
        if(!
strcmp(email[at_pos], providers[i], true))
        {
            return 
true;
        }
    }
    return 
false;

Reply


Messages In This Thread
Is valid email - by MerryDeer - 13.01.2017, 16:29
Re: Is valid email - by MerryDeer - 13.01.2017, 16:40
Re: Is valid email - by SickAttack - 13.01.2017, 16:58
Re: Is valid email - by MerryDeer - 13.01.2017, 17:00
Re: Is valid email - by SickAttack - 13.01.2017, 17:17
Re: Is valid email - by MerryDeer - 13.01.2017, 17:19
Re: Is valid email - by SickAttack - 13.01.2017, 19:17
Re: Is valid email - by MerryDeer - 13.01.2017, 19:45
Re: Is valid email - by SickAttack - 13.01.2017, 20:04
Re: Is valid email - by Sew_Sumi - 13.01.2017, 21:03

Forum Jump:


Users browsing this thread: