Nevermind ! I resolved it !
What I did :
1. Get the Headers of the URL.
2. Filter the Headers and look for Location header.
3. Now Use it ;)
<?php
$url = 'https://graph.facebook.com/thakurbhai/picture';
$location = get_headers($url, 1);
if (array_key_exists('Location', $location))
{
echo $location['Location'];
}
?>
Remember: I am Getting Headers for a Secure URl, i.e, HTTPS (https://graph.facebook.com/thakurbhai/picture)
For doing that, you must have php_openssl enabled on your server.
Or you can do something like this :
<?php
if (extension_loaded('openssl'))
{
$url = 'https://graph.facebook.com/thakurbhai/picture';
$location = get_headers($url, 1);
if (array_key_exists('Location', $location))
{
echo $location['Location'];
}
}
else
{
echo "Sorry ! Open SSL Not enabled.";
}
?>