fork(2) download
  1. <?php
  2.  
  3. $_POST['user_email'] = " abc@gmail.com "; // example post request
  4. $email = $_POST['user_email'];
  5.  
  6. $regex = "/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/";
  7.  
  8. if (preg_match ($regex, $email )){
  9. echo $email . " is a valid email";
  10. }else{
  11. echo $email. " is an invalid email ";
  12. }
  13.  
  14. ?>
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
 abc@gmail.com  is an invalid email