title: How can I use PHP to get just the base name from a long url?
body: <p>If I have a variable that contains a URL, then how can I get the base URL? That is,</p>
  
  <pre><code>$url = 'http://www.domain.com/some/stuff/that/I/do/not/want/';
  $base_url = some_clever_function($url);
  // $base_url is now set equal to 'domain.com'
  </code></pre>
  
  <p>How can I do this?</p>