PHP ~ validate email ~ filter_var

想不到PHP本身就有內建驗證的函示了= =

而且還蠻好用的XD

if(filter_var('xzbgh32twsgr@wetgag3q44trav.com', FILTER_VALIDATE_EMAIL))
{
print 'y';
}
else
{
print 'n';
}


reference
http://php.net/manual/en/function.filter-var.php

沒有留言: