fork download
  1. <?php
  2.  
  3.  
  4. $email = 'a."b@c".d."@".e.f@g.h';
  5. $parts = explode("@", $email);
  6. $domain = array_pop($parts);
  7. $name = implode("@",$parts);
  8. echo "name: ".$name."\n";
  9. echo "domain: ".$domain."\n";
  10. $email = '/."@@@@@@"./@a.b';
  11. $parts = explode("@", $email);
  12. $domain = array_pop($parts);
  13. $name = implode("@",$parts);
  14. echo "name: ".$name."\n";
  15. echo "domain: ".$domain."\n";
  16.  
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
name: a."b@c".d."@".e.f
domain: g.h
name: /."@@@@@@"./
domain: a.b