This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Tools to process end extract log data from text files | |
* Ex: php extract-emails.php -f text.txt -o emails.txt | |
*/ | |
function extract_emails ($from_text = "") | |
{ | |
$emails = []; | |
if(!empty($from_text)) { | |
$res = preg_match_all( | |
"/[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}/i", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Tools to process end extract log data from Proftpd.log files | |
* Ex: php extract.php -f ftp_in.log -s PUT-o ftp_out.log | |
*/ | |
$options = getopt("f:s:o:"); | |
if (isset($options['f']) && isset($options['o']) && $options['s'] && strlen($options['s'])>0 ){ | |
if (!file_exists($options['f'])){ | |
die("Eroare: Nu am gasit fisierul pentru citire!"); |