Answer the question
In order to leave comments, you need to log in
Can curl be used multiple times?
Is it possible to do so?
$curl = curl_init();
//Назначили нужные параметры
curl_exec($curl);
//Снова назначили параметры, только другие, и снова:
curl_exec($curl);
curl_close($curl);
Answer the question
In order to leave comments, you need to log in
It is possible and even necessary for sequential requests to the same host - curl can HTTP / 1.1 and keep-alive, respectively, too: https://habrahabr.ru/post/184302/
Cookies - still CURLOPT_COOKIEFILE and CURLOPT_COOKIEJAR. If you need only within this script and nowhere else, use the tempnam(sys_get_temp_dir(), 'some name') function to create a temporary file.
Well, or CURLOPT_COOKIE, but then parse the cookies from the last answer yourself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question