Hi
this may help you :
<?php
function findEmails($string){
$email_regular_expression="([-!#\$%&'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#\$%&'*+/0-9=?A-Z^_`a-z{|}~]+\\.)+[a-zA-Z]{2,24}";
preg_match_all('/'.str_replace('/', '\\/', $email_regular_expression).'/', $string,$matches);
return $matches[0];
}
$string="email,firstname,lastname,address,phone,notes,ip,time
[email protected],john,doe,,,
[email protected],Jane,Doe,,,";
echo '<pre>';
print_r(findEmails($string));
/*result :
Array
(
[0] =>
[email protected]
[1] =>
[email protected]
)
*/
?>
so you may from there use the output of this function to fill the php mailinglist sanitizer method "EmailChecker::ARprocess"
as shown in the example file and all will be done
your complete script may be
<?php
require_once('EmailChecker.class.php');
function findEmails($string){
$email_regular_expression="([-!#\$%&'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#\$%&'*+/0-9=?A-Z^_`a-z{|}~]+\\.)+[a-zA-Z]{2,24}";
preg_match_all('/'.str_replace('/', '\\/', $email_regular_expression).'/', $string,$matches);
return $matches[0];
}
$var=file_get_contents('yourfile.csv');//get the content from your file in any plain text format;
$emails=findEmails($var);//retrieve the emails
$x=new EmailChecker(); // create your checker object
$x->ARprocess($ar,time().'.csv'));//call the array sanitizer...sanitize and save to timestamp.csv(you can choose your own name provided that the file doesn't exist)
?>