Get Rid of Duplicate Information in PHP
<p>Ok, so I've got a bit of a problem.</p>

<p>I am scraping a site, and it will scrape two address boxes - each of which may have minor differences.</p>

<p>One of the addresses is like this:</p>

<pre><code>ONE MICROSOFT WAY
REDMOND WA 98052-6399
425-882-8080
</code></pre>

<p>And the other is like this:</p>

<pre><code>ONE MICROSOFT WAY
REDMOND WA 98052-6399
</code></pre>

<p>I save the entire string for both (there's HTML tags around them in the original but I didn't think it was necessary to illustrate my point), and then separate based on those HTML tags. This means it processes each newline (i.e. ONE MICROSOFT WAY) as a separate variable.</p>

<p>What I want to do is to see if there are duplicates between the addresses, the problem is that they're separate values in the first array, and then in the internal array (I'm not sure the terms for PHP, so bare with me), it is separating each of the two addresses line by line.</p>

<p>So basically, is there a way to check for duplicate values?</p>

<p>Here is sample data:</p>

<pre><code>&lt;div class="mailer"&gt;
Mailing Address
&lt;span class="mailerAddress"&gt;ONE MICROSOFT WAY&lt;/span&gt;
&lt;span class="mailerAddress"&gt;REDMOND WA 98052-6399&lt;/span&gt;
&lt;div class="mailer"&gt;
Business Address
&lt;span class="mailerAddress"&gt;ONE MICROSOFT WAY&lt;/span&gt;
&lt;span class="mailerAddress"&gt;REDMOND WA 98052-6399&lt;/span&gt;
&lt;span class="mailerAddress"&gt;425-882-8080&lt;/span&gt;
</code></pre>
