title: PHP Remove Domain Name Extension from String
body: <p>I was wondering of the best way of removing certain things from a domain using PHP.</p>
  
  <p><strong>For example:</strong></p>
  
  <p>"<em>http://mydomain.com/</em>" into "<em>mydomain</em>"</p>
  
  <p>or</p>
  
  <p>"<em>http://mydomain.co.uk/</em>" into "<em>mydomain</em>"</p>
  
  <p>I'm looking for a quick function that will allow me to remove such things as:</p>
  
  <p>"http://", "www.", ".com", ".co.uk", ".net", ".org", "/" etc</p>
  
  <p>Thanks in advance :)</p>