Detect if an image is in the same hosting
<p>I have the following problem whichI don't know how to solve.</p>

<p>I have a string taken from a different site with html code. What I want is to delete all the images from this string which are not hosted in that source. How can I do that ?</p>

<p>Example of the string :</p>

<pre><code>&lt;h1&gt;Titlte&lt;h1/&gt;content of the url &lt;a href=""&gt;&lt;img ...  /&gt;&lt;/a&gt;
</code></pre>

<p>The original url of the site is in a variable called $link</p>

<p>Thanks in advance!</p>
