-1

I have below remote URL

http://cdn.amazon.com/picture/f184a6f7b9c4371cf962537ff384a362d97aa495044995079bca063aeb66d8c0

When I copy/paste this URL in browser then it gives me

http://cdn.amazon.com/picture/logo

How to get above URL? I want to compare with this browser URL & process the functionality.

1 Answers1

0

If you want to get actual URL from the PHP (I hope you are asking it)

Default PHP file_get_contents method doesn't want to wait for redirects. It means if you are asking some URL which has a redirect, PHP doesn't follow this redirect and waiting for a final content.

You can use cURL with "Follow Redirect params": https://stackoverflow.com/a/3520085/2552784

Or use guzzlehttp/guzzle. It is a very good PSR-7 wrapper of the cURL library.