title: PHP: Get path after domain from current URL
body: <p>I am a complete beginner to PHP, so please keep that in mind.</p>
  
  <p>I am attempting to get JUST the path from the current URL, which is variable. For instance, if the current URL is <code>http://example.com/blog/2014/blogpost.html</code> then I would like to get <code>/blog/2014</code> or something very similar.</p>
  
  <p>This is the PHP code I have so far:</p>
  
  <pre><code>$full_url = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
  $path_info =  parse_url($full_url,PHP_URL_PATH);
  echo $path_info;
  </code></pre>
  
  <p>However, this does not work, and I can't seem to Google a suitable solution.</p>
  
  <p>Does anyone have any pointers?</p>
  
  <p>Thanks in advance!</p>