Reputation: 2088
How can I modify the preg_match function below to allow all email addresses ending with harvard.edu email addresses, instead of only those with @college.harvard.edu?
if(!preg_match("/@college\.harvard\.edu$/", $_POST["username"]))
{
apologize("You must provide a Harvard email to register.");
}
Upvotes: 1
Views: 2104
Reputation: 3710
if(!preg_match("/@.*harvard\.edu$/", $_POST["username"]))
{
apologize("You must provide a Harvard email address to register.");
}
Upvotes: 6