I need to get the URL of a redirected page in PHP.
Let's say I have an URL like http://example.com
, while I open this, it redirects to http://redirected_url.com
. So the input and output of this PHP function must be like this:
- Input:
http://example.com
- Output:
http://redirected_url.com
How can I do this?
Edit: 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.