Basically i have two files with strings in them separated with a new line.

What i wish to do is get the first string from the first file and compare it to ALL of the strings from the second file. Then get the second string from the first file and compare it to ALL of the strings in the second file then get the third and etc etc.

Currently i have this piece of code, but i am not sure if it is working as i wish it to be

```
$file = file_get_contents("file1.txt");
$pieces = explode("\n", trim($file));
foreach($pieces as $piece)
{
    $file2 = file_get_contents("file2.txt");
    $pieces2 = explode("\n", trim($file2));
    foreach($pieces2 as $piece2)
    {
        if($piece == $piece2)
        echo 'yes';
    }
}

```