Welcome Guest, Not a member yet? Register   Sign In
Email validation
#2

[eluser]Madmartigan1[/eluser]
I think [email protected] is technically valid...?

Code:
/**
     * Valid Email
     *
     * @access    public
     * @param    string
     * @return    bool
     */
    function valid_email($str)
    {
        return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
    }

You can create MY_Form_Validation.php and override the function there with your own. See the user guide section about extending libraries and have a look at system/libraries/Form_Validation.php


Messages In This Thread
Email validation - by El Forum - 12-14-2010, 02:06 PM
Email validation - by El Forum - 12-15-2010, 02:57 AM
Email validation - by El Forum - 12-15-2010, 03:04 AM
Email validation - by El Forum - 12-15-2010, 03:34 AM
Email validation - by El Forum - 12-15-2010, 03:40 AM
Email validation - by El Forum - 12-15-2010, 03:53 AM
Email validation - by El Forum - 12-15-2010, 07:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB