How can I find where I will be redirected using cURL?

前端 未结 7 1982
小鲜肉
小鲜肉 2020-11-22 03:53

I\'m trying to make curl follow a redirect but I can\'t quite get it to work right. I have a string that I want to send as a GET param to a server and get the resulting URL.

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-22 04:35

    You can use:

    $redirectURL = curl_getinfo($ch,CURLINFO_REDIRECT_URL);
    

提交回复
热议问题