I have json. It's consider information about merchants exactly id, link. But this link go to redirect. Like this:
http:\/\/partners.webmasterplan.com\/click.asp?ref=593856&site=5051&type=banner&tnb=1
I need to view all this links and link which will be last in the chain of redirection i should save. What is better way to make it? Technology, or...? Can you give me some advice? Thx!
I found code can it help me?
<?php
$url="http://libero-news.it.feedsportal.com/c/34068/f/618095/s/2e34796f/l/0L0Sliberoquotidiano0Bit0Cnews0C12735670CI0Esaggi0Eper0Ele0Eriforme0Ecostituzionali0EChiaccherano0Ee0Eascoltano0Bhtml/story01.htm";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$a = curl_exec($ch);
print_r($a);echo"<br>";
if(preg_match('#Location: (.*)#', $a, $r)){
$l = trim($r[1]);
echo $l;
}else echo "not working";
?>