coop Posted December 27, 2006 Share Posted December 27, 2006 Hi all,I have this function for checking valid emails but I'm a bit stuck with some of the code[code]function valid_email($email){ // check if email is valid if( !eregi(“^[a-z0-9]+([_\\.-][a-z0-9]+)*”.”@([a-z0-9]+([\.-][a-z0-9]+))*$”,$email, $regs)){ return false; } else if( gethostbyname($regs[2]) == $regs[2] ){ // if host is invalid return false; } else { return true; }}[/code]it's this bit I dont understand[code]!eregi(“^[a-z0-9]+([_\\.-][a-z0-9]+)*”.”@([a-z0-9]+([\.-][a-z0-9]+))*$”,$email, $regs)[/code]I know eregi is the case insensitive regular expression match, but it's the rest I dont understand, could someone explain. Link to comment https://forums.phpfreaks.com/topic/31992-code-explanation/ Share on other sites More sharing options...
craygo Posted December 27, 2006 Share Posted December 27, 2006 this might help explainhttp://weblogtoolscollection.com/regex/regex.phpRay Link to comment https://forums.phpfreaks.com/topic/31992-code-explanation/#findComment-148477 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.