Advertisement
ANIKI12

email extract [ Remove Duplicat ]

Oct 17th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1. <?php
  2. /*
  3.     Coded By Aniki
  4.     26 april 2018
  5.     http://kimsohyun.net
  6. */
  7. echo "===== PPQToolz - Email Extract [ Remove Duplicat ] ===== \n";
  8. echo "====================================================";
  9. echo "\n Select Mailist : " ;$list = trim(fgets(STDIN));
  10.  
  11. //cek file
  12. if(!file_get_contents($list)){
  13.     die("\nFile Not Found ! ");
  14. }
  15. $mailist = file_get_contents($list);
  16. echo "Save to : "; $filetujuan = trim(fgets(STDIN));
  17.  
  18. // extract mail & get info
  19. if(preg_match("/live =>/",$mailist)){
  20.     $mailist = str_replace("live => ","",$mailist);
  21. }
  22. $mail = explode("\n",$mailist);
  23. $r_mail = array_unique($mail);
  24. $before = count($mail) - count($r_mail);
  25.  
  26. //Tampilkan & Save
  27. foreach( $r_mail as $emel ) {
  28.     echo "[ Duplicat Removed ] ".$emel."\n";
  29.     $buka = fopen("$filetujuan","a");
  30.     fwrite($buka,$emel);
  31.     fwrite($buka,"\n");
  32.     fclose($buka);
  33. }
  34.    
  35.     //tanjukkan info
  36.     echo "\n Total Mailist : ".count($mail)."\n Removed : ".$before."\n Result : ".count($r_mail);
  37.     echo"\n Check in /$filetujuan \n";
  38.     echo "powered by kimsohyun.net \n";
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement