title: Delete subdomain from url string if subdomain is found
body: <p>I have an array of domains like this:</p>
  
  <pre><code>domain.com
  second.com
  www.third.com
  www.fourth.fifth.com
  sixth.com
  seventh.eigth.com
  </code></pre>
  
  <p>what I want is a function to return me the host only. Without subdomain.</p>
  
  <p>This code is what i have so far for getting the hostname:</p>
  
  <pre><code>$parse = parse_url($url);
  $domain = $parse['host'];
  </code></pre>
  
  <p>But this returns this only:</p>
  
  <pre><code>domain.com
  second.com
  third.com
  fourth.fifth.com
  sixth.com
  seventh.eigth.com
  </code></pre>
  
  <p>I would need this output though:</p>
  
  <pre><code>domain.com
  second.com
  third.com
  fifth.com
  sixth.com
  eigth.com
  </code></pre>