Dear all ,
i would like to know if email in a file is in my database and return me only wich are not
her is my code :
[php]$tabmail = array();
//on fait un tableau avec les mails en base
$query = “select email from wp_MailPress_users”;
$exec = mysql_query($query);
while ( $stockmail = mysql_fetch_row($exec))
{
$tabmail[]=trim($stockmail[0]);
}
$n = sizeof($tabmail);
echo “Nombre de mails en base: “.$n.”
Les Emails ci dessous ne sont pas en base :
”;
//print_r($tabmail);
//on lance la comparaison
$ficmail = fopen(“tmp/fullmail.txt”,“r”);
while ($line = fgets($ficmail))
{
$tabline = explode("\t", trim($line));
$email = $tabline[8];
$nom = $tabline[2];
$cp = $tabline[5];
if(!in_array($email, $tabmail))
{
echo "<br />".$line;
}
}
fclose($ficmail);
unlink(“tmp/fullmail.txt”);[/php]
but it return me all mails in my file … where is my mistake please ?
Bst Rgds