https://ideone.com/hfTGLS
- <?php
- function is_email(String $email)
- {
- if (!preg_match('/[a-z||0-9]@[a-z||0-9].[a-z]/', $email)){
- return false;
- //return "Girilen Email Formatı uygun degildir.";
- }
- if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
- return $email;
- }
- return "Girilen Email Formatı uygun degildir.";
- }
- ?>
ne gerek var onlara <input type="email" required> dersen zaten boş geçilemez olacak.