I am trying to compare two txt files, and return which email address exist in both files. I don't know what I am doing wrong, but I get
Array()
If anyone has any ideas PLEASE help!
F1 has just email addresses
F2 has email, first name, Last name ( in that order )
$F1 = file("F1.txt");
$F2= file("F2.txt");
$new = array();
for ( $i=0; $i<count($F2); $i++ )
{
$new[] = explode("\t",$F2[$i]);
}
$rebar = array();
for ( $n=0; $n<count($new); $n++ )
{
$rebar[] = $new[$n][0];
}
$result = array_intersect($F1,$rebar);
print_r($result);