<?php
$url = r('url');//'https://url.cn/5MmbOlY';

$oCurl = curl_init();
 curl_setopt($oCurl, CURLOPT_URL, $url);
 //curl_setopt($oCurl, CURLOPT_HTTPHEADER, $header);
//关闭https验证
 curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, false);
 curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false);
//至关重要，CURLINFO_HEADER_OUT选项可以拿到请求头信息
curl_setopt($oCurl, CURLINFO_HEADER_OUT, TRUE);
curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($oCurl, CURLOPT_POST, 1);
curl_setopt($oCurl, CURLOPT_POSTFIELDS, $bodystr);
$sContent = curl_exec($oCurl);
//通过curl_getinfo()可以得到请求头的信息
$a=curl_getinfo($oCurl);

echo $a['redirect_url'];
?>