Advertisement
shor7cut

php filter email

Oct 27th, 2016
2,017
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. function save($data,$name){
  2.     $fopn = fopen($name, "a+");
  3.     fwrite($data."\r\n", $fopn);
  4.     fclose($fopn);
  5. }
  6. $file = explode("\r\n", file_get_contents("filname.txt"));
  7. foreach ($file as $key => $email) {
  8.     if(eregi("gmail.com", $email)){
  9.         save($email,"gmail.txt");
  10.         echo $email."\r\n";
  11.     }
  12.     if(eregi("yahoo.com", $email)){
  13.         save($email,"yahoo.txt");
  14.         echo $email."\r\n";
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement