How to extract the website's URL from a page's URL?
<p>I have to extract the website's URL from a page's URL.
For example, this is my php code:</p>

<pre><code>&lt;?php

$pageA = "http://stackoverflow.com/questions/tagged/php";
$pageB = "https://www.google.it/search?channel=cs&amp;ie=UTF-8&amp;q=php+download";
$pageC = "http://www.facebook.com/ladygaga";
$pageD = "www.youtube.com";
$pageE = "yahoo.com";

?&gt;
</code></pre>

<p>and I have to extract </p>

<pre><code>stackoverflow.com
www.google.it
www.facebook.com
www.youtube.com
yahoo.com
</code></pre>

<p>from these page's URL.</p>
