YouTip LogoYouTip

Func Curl_Multi_Info_Read

# PHP curl_multi_info_read Function [![Image 3: PHP Calendar Reference Manual](#) PHP cURL Reference Manual](#) (PHP 5) curl_multi_info_read β€” Get information about the current transfers on a given cURL multi handle * * * ## Description array curl_multi_info_read ( resource $mh [, int &$msgs_in_queue = NULL ] ) Checks if there are any messages or information available from the individual transfer threads of the batch handle. Messages may include reports such as error codes returned from individual transfer threads or simply whether a transfer thread has finished. Calling this function repeatedly will return a new result each time until there is no more information to return, at which point FALSE is returned as a signal. The integer returned via msgs_in_queue indicates the number of messages remaining after this function call. **Note:** The data pointed to by the returned resource will not exist after calling curl_multi_remove_handle(). * * * ## Parameters **mh** A cURL multi handle returned by curl_multi_init(). **msgs_in_queue** The number of messages still in the queue. * * * ## Return Values Returns an array with information on success, or FALSE on failure. Return value contents (contents of the returned array): | Key | Value | | --- | --- | | _msg_ | The **`CURLMSG_DONE`** constant. Other return values are currently not available. | | _result_ | One of the **`CURLE_*`** constants. If everything is okay, the **`CURLE_OK`** constant will be returned. | | _handle_ | The cURL resource type, indicating the handle it relates to. | * * * ## Example $url) { $conn[$i] = curl_init($url); curl_setopt($conn[$i], CURLOPT_RETURNTRANSFER, 1); curl_multi_add_handle($mh, $conn[$i]);}do { $status = curl_multi_exec($mh, $active); $info = curl_multi_info_read($mh); if (false !== $info) { var_dump($info); }} while ($status === CURLM_CALL_MULTI_PERFORM || $active);foreach ($urls as $i => $url) { $res[$i] = curl_multi_getcontent($conn[$i]); curl_close($conn[$i]);} var_dump(curl_multi_info_read($mh));?> The output of the above example is similar to: array(3) { => int(1) => int(0) => resource(5) of type (curl)} array(3) { => int(1) => int(0) => resource(7) of type (curl)} array(3) { => int(1) => int(0) => resource(6) of type (curl)}bool(false) * * * ## Changelog | Version | Description | | --- | --- | | 5.2.0 | _`msgs_in_queue`_ was added. | * * PHP cURL Reference Manual](#)
← Func Curl_Multi_InitFunc Curl_Multi_Getcontent β†’