cURL , get redirect url to a variable

前端 未结 4 1179
一整个雨季
一整个雨季 2020-11-27 17:50

I\'m using curl to fill a form. After completion of the post the other script which handles the form is redirecting to another URL. I want to get this redirect URL into a va

4条回答
  •  自闭症患者
    2020-11-27 18:22

    Easy way to find the redirected url (if you don't want to know in advance)

    $last_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
    

提交回复
热议问题