Guest User

Untitled

a guest
Dec 18th, 2015
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <?php
  2.  
  3. $lines = file('url.txt'); // строки файла в массив
  4.  
  5. foreach ($lines as $line_num => $line) {
  6.  
  7. $html_lines = file("$line"); //cуем в file url и получаем массив со строками хтмл
  8.  
  9. foreach ($html_lines as $line_num => $line)
  10. {
  11.    
  12. preg_match('/([a-z0-9_\.\-])+\@(([a-z0-9\-])+\.)+([a-zа-я0-9]{2,4})+/i', $line, $matches); //выдираем мейлы из html
  13.  
  14. foreach($matches as $key => $val) // cохраняем массив найденных мейлов в файл
  15. {
  16. $save = $val."\n";
  17. file_put_contents('mail.txt', $save, FILE_APPEND);
  18. }
  19.  
  20. }
  21.                                         }
  22. ?>
Add Comment
Please, Sign In to add comment