1$email=$_POST['email'];
2
3$emailPattern = '/^\w{2,}@\w{2,}\.\w{2,4}$/';
4$mobilePattern ="/^[7-9][0-9]{9}$/";
5
6if(preg_match($emailPattern, $email)){
7 echo "Email Success!";
8} else if(preg_match($mobilePattern, $email)){
9 echo "Mobile Success!";
10} else {
11 echo "Invalid entry";
12}
13