title: Getting the URL of redirected page in PHP
body: <p>I need to get the URL of a redirected page in PHP.</p>
  
  <p>Let's say I have an URL like <code>http://example.com</code>, while I open this, it redirects to <code>http://redirected_url.com</code>. So the input and output of this PHP function must be like this:</p>
  
  <ul>
  <li>Input: <code>http://example.com</code> <br/></li>
  <li>Output: <code>http://redirected_url.com</code></li>
  </ul>
  
  <p>How can I do this?</p>
  
  <p><strong>Edit:</strong> I don't mean redirection. I need the url of redirected page. So I don't know redirected url, but I need to find it.</p>