Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function validateEmail(string $email): bool
- {
- //remove unwanted chars that maybe included in the email field content
- $email = filter_var($email, FILTER_SANITIZE_EMAIL);
- if (!filter_var($email, FILTER_VALIDATE_EMAIL) {
- return false;
- }
- if (false === strpos(strtolower($email), '@admin')) {
- return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement