title: Get current URL path with query string in PHP
body: <p>I need to get the path from the URL of the current request. For example, if the current URL is:</p>
  
  <pre><code>"http://www.example.com/example/test/hi.php?randomvariable=1"
  </code></pre>
  
  <p>I would want this:</p>
  
  <pre><code>"/example/test/hi.php?randomvariable=1"
  </code></pre>